Question: In recent versions of MySQL (8.0+), what's the correct syntax to declare a CTE (Common Table Expression)?

  1. WITH (SELECT id FROM users) as cte, SELECT ...
  2. WITH (SELECT id FROM users) as cte SELECT ...
  3. WITH cte as (SELECT id FROM users), SELECT ...
  4. WITH cte as (SELECT id FROM users) SELECT ...

Answer: The correct answer of the above question is Option D:WITH cte as (SELECT id FROM users) SELECT ...