0
0
SQLquery~10 mins

What is SQL - Interactive Quiz & Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select all columns from the table named 'employees'.

SQL
SELECT [1] FROM employees;
Drag options to blanks, or click blank then click option'
A*
BALL
Ceverything
Dcolumns
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like ALL or columns instead of *
Leaving the blank empty
2fill in blank
medium

Complete the code to filter rows where the age is greater than 30.

SQL
SELECT * FROM users WHERE age [1] 30;
Drag options to blanks, or click blank then click option'
A=
B>
C<
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=' which selects only age exactly 30
Using '<' which selects ages less than 30
3fill in blank
hard

Fix the error in the code to count the number of rows in the 'orders' table.

SQL
SELECT COUNT([1]) FROM orders;
Drag options to blanks, or click blank then click option'
Aall
Border_id
Crows
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using a column name that might have NULLs and miss some rows
Using words like 'all' or 'rows' which are not valid here
4fill in blank
hard

Fill both blanks to select the name and age from 'students' where age is less than 20.

SQL
SELECT [1], age FROM students WHERE age [2] 20;
Drag options to blanks, or click blank then click option'
Aname
B>
C<
Dstudent_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '<' for filtering age
Using wrong column names like 'student_name'
5fill in blank
hard

Fill all three blanks to select the city and count of customers from 'customers' grouped by city having more than 5 customers.

SQL
SELECT [1], COUNT([2]) FROM customers GROUP BY [3] HAVING COUNT([2]) > 5;
Drag options to blanks, or click blank then click option'
Acity
B*
Dcustomer_id
Attempts:
3 left
💡 Hint
Common Mistakes
Using different columns for grouping and selecting
Counting a specific column that might have NULLs