0
0
SQLquery~10 mins

WHERE with LIKE pattern matching 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 customers whose names start with 'A'.

SQL
SELECT * FROM customers WHERE name [1] 'A%';
Drag options to blanks, or click blank then click option'
ALIKE
B=
CIN
DBETWEEN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' instead of LIKE causes exact match only.
Using IN or BETWEEN does not support pattern matching.
2fill in blank
medium

Complete the code to find products with 'book' anywhere in their description.

SQL
SELECT * FROM products WHERE description [1] '%book%';
Drag options to blanks, or click blank then click option'
A=
BBETWEEN
CIN
DLIKE
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' only matches exact descriptions.
Using IN or BETWEEN does not work for pattern matching.
3fill in blank
hard

Fix the error in the query to find emails ending with '.com'.

SQL
SELECT email FROM users WHERE email [1] '%.com';
Drag options to blanks, or click blank then click option'
A=
BBETWEEN
CLIKE
DIN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' causes no matches unless exact string is '.com'.
Using IN or BETWEEN is invalid for pattern matching.
4fill in blank
hard

Fill both blanks to select orders where the status starts with 'sh' and ends with 'ed'.

SQL
SELECT * FROM orders WHERE status [1] 'sh%' AND status [2] '%ed';
Drag options to blanks, or click blank then click option'
ALIKE
B=
CIN
DBETWEEN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' causes exact match only, so no partial matches.
Using IN or BETWEEN is not valid for pattern matching.
5fill in blank
hard

Fill all three blanks to select employees whose first name contains 'an', last name starts with 'S', and email ends with '.org'.

SQL
SELECT * FROM employees WHERE first_name [1] '%an%' AND last_name [2] 'S%' AND email [3] '%.org';
Drag options to blanks, or click blank then click option'
ALIKE
B=
CIN
DBETWEEN
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' causes exact matches only.
Using IN or BETWEEN is invalid for pattern matching.