0
0
MySQLquery~10 mins

BETWEEN range filtering in MySQL - 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 products with prices between 10 and 50.

MySQL
SELECT * FROM products WHERE price [1] 10 AND 50;
Drag options to blanks, or click blank then click option'
A>=
BIN
CBETWEEN
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of BETWEEN causes only exact matches.
Using 'IN' expects a list of values, not a range.
2fill in blank
medium

Complete the code to find orders with order_date between '2023-01-01' and '2023-01-31'.

MySQL
SELECT * FROM orders WHERE order_date [1] '2023-01-01' AND '2023-01-31';
Drag options to blanks, or click blank then click option'
ABETWEEN
B<
C>
DIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'IN' with two dates does not work as a range filter.
Using '>' or '<' alone misses one boundary.
3fill in blank
hard

Fix the error in the code to correctly filter ages between 18 and 30.

MySQL
SELECT name FROM users WHERE age [1] 18 AND 30;
Drag options to blanks, or click blank then click option'
AFROM
BBETWEEN
CIN
DAND
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'TO' instead of 'AND' causes syntax errors.
Using 'IN' with a range is incorrect.
4fill in blank
hard

Fill both blanks to select employees with salaries between 3000 and 7000.

MySQL
SELECT * FROM employees WHERE salary [1] 3000 [2] 7000;
Drag options to blanks, or click blank then click option'
ABETWEEN
BIN
CAND
DOR
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'IN' instead of 'BETWEEN' causes errors.
Using 'OR' instead of 'AND' changes the logic.
5fill in blank
hard

Fill all three blanks to select products with quantity between 5 and 20 and price less than 100.

MySQL
SELECT * FROM products WHERE quantity [1] 5 [2] 20 AND price [3] 100;
Drag options to blanks, or click blank then click option'
ABETWEEN
B<
CAND
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '<' for price changes the filter.
Mixing up 'AND' and 'OR' changes the logic.