Complete the code to find all names starting with 'A'.
SELECT * FROM users WHERE name LIKE '[1]';
The pattern 'A%' matches any string starting with 'A'.
Complete the code to find all emails ending with '.com'.
SELECT email FROM contacts WHERE email LIKE '[1]';
The pattern '%.com' matches any string ending with '.com'.
Fix the error in the code to find names with exactly 5 characters.
SELECT name FROM employees WHERE name LIKE '[1]';
The underscore (_) matches exactly one character. Five underscores match names with exactly 5 characters.
Fill both blanks to find products with names containing 'pro' anywhere.
SELECT * FROM products WHERE product_name LIKE '[1]' OR product_name LIKE '[2]';
The pattern '%pro%' matches any string containing 'pro' anywhere.
Fill all three blanks to find users whose username starts with 'a', ends with 'z', and has exactly 5 characters.
SELECT username FROM users WHERE username LIKE '[1]' AND username LIKE '[2]' AND username LIKE '[3]';
'a____' matches usernames starting with 'a' and 5 characters long.
'____z' matches usernames ending with 'z' and 5 characters long.
'_____' matches usernames with exactly 5 characters.
Combined, these ensure usernames start with 'a', end with 'z', and have exactly 5 characters.