Question · SQL and MySQL course · Module 8: Subqueries

SELECT 1 in EXISTS

Why do we often write SELECT 1 inside an EXISTS subquery?

Answer options

  • Because SELECT 1 returns exactly the first column of the table
  • Because the number 1 means the first author in the database
  • Because EXISTS always requires a constant number instead of columns
  • Because for EXISTS it does not matter what we select - only whether any row appears at all

You can check the correct answer by solving this task in the CodeWorlds game.