0
0
SQLquery~10 mins

WHERE with BETWEEN range 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 employees with salaries between 3000 and 7000.

SQL
SELECT * FROM employees WHERE salary [1] 3000 AND 7000;
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 products with prices between 10 and 50.

SQL
SELECT product_name FROM products WHERE price [1] 10 AND 50;
Drag options to blanks, or click blank then click option'
ABETWEEN
BLIKE
CIN
DNOT
Attempts:
3 left
💡 Hint
Common Mistakes
Using LIKE is for pattern matching, not ranges.
Using IN expects a list of discrete values.
3fill in blank
hard

Fix the error in the code to correctly select orders with order_date between '2023-01-01' and '2023-01-31'.

SQL
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
BIN
C=
DLIKE
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' only matches one date.
Using IN expects a list of values, not a range.
4fill in blank
hard

Fill both blanks to select customers with age between 18 and 30.

SQL
SELECT * FROM customers WHERE age [1] [2];
Drag options to blanks, or click blank then click option'
ABETWEEN
BIN
C18 AND 30
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using IN instead of BETWEEN for ranges.
Not including both boundary values in the range.
5fill in blank
hard

Fill all three blanks to select orders with total_amount between 100 and 500.

SQL
SELECT order_id FROM orders WHERE total_amount [1] [2] [3];
Drag options to blanks, or click blank then click option'
ABETWEEN
B100
CAND
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using > instead of BETWEEN for range filtering.
Omitting the AND keyword between range values.