Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select all records from the users table.
SQL
SELECT [1] FROM users; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using ALL or EVERY instead of * to select all columns.
✗ Incorrect
The asterisk (*) selects all columns from the table.
2fill in blank
mediumComplete the code to find records where age is greater than 30.
SQL
SELECT * FROM employees WHERE age [1] 30;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or '=' instead of '>' for greater than comparison.
✗ Incorrect
The '>' operator means 'greater than' in SQL.
3fill in blank
hardFix the error in the SQL query to count the number of orders.
SQL
SELECT COUNT([1]) FROM orders; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNT(orders) or COUNT(all) which are invalid.
✗ Incorrect
Using COUNT(*) counts all rows in the table.
4fill in blank
hardFill both blanks to select names and ages of employees older than 25.
SQL
SELECT [1], [2] FROM employees WHERE age > 25;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Selecting salary or department instead of name and age.
✗ Incorrect
We select 'name' and 'age' columns to see employees' names and ages.
5fill in blank
hardFill all three blanks to create a dictionary of product names and prices where price is above 100.
SQL
SELECT [1], [2] FROM products WHERE [3] > 100;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using quantity instead of price in the WHERE clause.
✗ Incorrect
Select product_name and price columns where price is greater than 100.