Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to find the smallest price from the products table.
MySQL
SELECT [1](price) FROM products; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using MAX instead of MIN.
Using SUM or COUNT which do not return minimum values.
✗ Incorrect
The MIN function returns the smallest value in a column.
2fill in blank
mediumComplete the code to find the highest score from the scores table.
MySQL
SELECT [1](score) FROM scores; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using MIN instead of MAX.
Using AVG or COUNT which do not return maximum values.
✗ Incorrect
The MAX function returns the largest value in a column.
3fill in blank
hardFix the error in the query to get the maximum age from the users table.
MySQL
SELECT [1]age) FROM users; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting parentheses after MAX or MIN.
Using MIN instead of MAX.
✗ Incorrect
The function call must include parentheses around the column name, so MAX(age) is correct.
4fill in blank
hardFill both blanks to find the smallest and largest salary from the employees table.
MySQL
SELECT [1](salary) AS min_salary, [2](salary) AS max_salary FROM employees;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping MIN and MAX.
Using SUM or COUNT instead of MIN or MAX.
✗ Incorrect
Use MIN to get the smallest salary and MAX to get the largest salary.
5fill in blank
hardFill all three blanks to find the minimum, maximum, and average rating from the reviews table.
MySQL
SELECT [1](rating) AS min_rating, [2](rating) AS max_rating, [3](rating) AS avg_rating FROM reviews;
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using COUNT instead of AVG for average.
Mixing up MIN and MAX.
✗ Incorrect
Use MIN for minimum, MAX for maximum, and AVG for average values.