0
0
SQLquery~10 mins

WHERE with IN list in SQL - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select all employees whose department is in the given list.

SQL
SELECT * FROM employees WHERE department [1] ('Sales', 'HR', 'IT');
Drag options to blanks, or click blank then click option'
AIN
B=
CLIKE
DBETWEEN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of 'IN' causes the query to check only one value.
Using 'LIKE' is for pattern matching, not list membership.
2fill in blank
medium

Complete the code to find products with IDs in the specified list.

SQL
SELECT name FROM products WHERE product_id [1] (101, 102, 103);
Drag options to blanks, or click blank then click option'
A=
BIN
CBETWEEN
DLIKE
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' only compares to one value, not a list.
Using 'BETWEEN' requires a range, not a list.
3fill in blank
hard

Fix the error in the query to correctly filter customers from specific cities.

SQL
SELECT * FROM customers WHERE city [1] ('New York', 'Chicago', 'Boston');
Drag options to blanks, or click blank then click option'
A=
BLIKE
CIN
DBETWEEN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' causes the query to check only one city.
Using 'LIKE' is for pattern matching, not list membership.
4fill in blank
hard

Fill both blanks to select orders with status in the list and amount greater than 100.

SQL
SELECT * FROM orders WHERE status [1] ('Pending', 'Shipped') AND amount [2] 100;
Drag options to blanks, or click blank then click option'
AIN
B>
C<
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of 'IN' for list filtering.
Using '<' instead of '>' for amount comparison.
5fill in blank
hard

Fill all three blanks to select employees with role in the list, salary above 50000, and department not 'HR'.

SQL
SELECT * FROM employees WHERE role [1] ('Manager', 'Developer') AND salary [2] 50000 AND department [3] 'HR';
Drag options to blanks, or click blank then click option'
AIN
B>
C!=
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of 'IN' for list filtering.
Using '<' instead of '>' for salary.
Using '=' instead of '!=' to exclude department.