Question · SQL and MySQL course · Module 3: Filtering (WHERE)
IN as a shortcut for OR
Which notation is equivalent to the condition: WHERE kategoria_id = 1 OR kategoria_id = 2 OR kategoria_id = 3 ?
Answer options
- WHERE kategoria_id BETWEEN 1 AND 3 always gives the same result for every table
- WHERE kategoria_id = (1, 2, 3)
- WHERE kategoria_id AND (1, 2, 3)
- WHERE kategoria_id IN (1, 2, 3)
You can check the correct answer by solving this task in the CodeWorlds game.