Question · SQL and MySQL course · Module 3: Filtering (WHERE)

Complex condition with BETWEEN and IN

What will the query return: SELECT * FROM ksiazki WHERE cena BETWEEN 20 AND 80 AND kategoria_id IN (1, 2) ?

Answer options

  • Books priced from 20 to 80 OR from category 1 or 2
  • All books from the table
  • Only books with a price of exactly 20 or 80
  • Books priced from 20 to 80 inclusive AND at the same time from category 1 or 2

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