Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Quiz

Total questions: 45

Worksheet time: 45mins

Name
Class
Date
1.

What is SQL used for?

a)

Graphic design

b)

Creating websites

c)

Video editing

d)

Storing and retrieving data in databases

2.

Which of the following is a popular database system for SQL?

a)

Photoshop

b)

Word

c)

MySQL

d)

Excel

3.

What does the SQL function AVG() do?

a)

Calculates the average value in a column

b)

Counts the number of rows

c)

Finds the maximum value

d)

Sorts the data

4.

What does the SQL keyword SELECT do?

a)

Deletes data from a database

b)

Retrieves data from a database

c)

Inserts data into a database

d)

Updates data in a database

5.

Which SQL function is used to find the maximum value in a column?

a)

COUNT

b)

SUM

c)

MIN

d)

MAX

6.

What is the purpose of SQL Joins?

a)

Update rows in a table

b)

Delete rows from a table

c)

Combine rows from two or more tables based on a related column between them

d)

Insert new rows into a table

7.

What does the SQL keyword WHERE do?

a)

Selects all records from a table

b)

Groups records based on a column

c)

Sorts records in ascending order

d)

Filters records based on specified conditions

8.

Which SQL function is used to count the number of rows in a table?

a)

AVG

b)

MAX

c)

COUNT

d)

SUM

9.

What is the purpose of SQL GROUP BY?

a)

Groups rows that have the same values into summary rows

b)

Deletes duplicate rows from a table

c)

Inserts new rows into a table

d)

Updates existing rows in a table

10.

Which SQL keyword is used to retrieve unique records?

a)

FILTER

b)

SORT

c)

UNIQUE

d)

DISTINCT

11.

What does the SQL function SUM() do?

a)

Calculates the sum of values in a column

b)

Finds the average value

c)

Counts the number of rows

d)

Sorts the data

12.

What is the purpose of SQL ORDER BY?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Selects all records from a table

d)

Groups records based on a column

13.

Which SQL function is used to find the minimum value in a column?

a)

MAX

b)

SUM

c)

MIN

d)

COUNT

14.

What does the SQL keyword INSERT INTO do?

a)

Adds new records to a table

b)

Deletes records from a table

c)

Updates existing records in a table

d)

Selects records from a table

15.

Which SQL keyword is used to combine the result set of two or more SELECT statements?

a)

ORDER BY

b)

GROUP BY

c)

UNION

d)

JOIN

16.

What is the purpose of SQL HAVING clause?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Applies a filter condition to groups of rows

17.

What is the purpose of SQL DISTINCT keyword?

a)

Deletes duplicate rows from a table

b)

Groups rows that have the same values into summary rows

c)

Inserts new rows into a table

d)

Retrieves unique records from a result set

18.

What does the SQL function COUNT() do?

a)

Calculates the average value in a column

b)

Counts the number of rows

c)

Finds the maximum value

d)

Sorts the data

19.

What is the purpose of the SQL keyword UPDATE?

a)

Deletes records from a table

b)

Updates existing records in a table

c)

Inserts new records into a table

d)

Retrieves data from a database

20.

Which SQL function is used to concatenate two or more strings?

a)

CONCAT

b)

JOIN

c)

COMBINE

d)

STRING

21.

What does the SQL keyword DELETE do?

a)

Updates existing records in a table

b)

Deletes records from a table

c)

Inserts new records into a table

d)

Retrieves data from a database

22.

What is the purpose of the SQL keyword WHERE?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Applies a filter condition to groups of rows

23.

Which SQL function is used to find the average value in a column?

a)

COUNT

b)

SUM

c)

MIN

d)

AVG

24.

What is the purpose of SQL LIMIT clause?

a)

Deletes duplicate rows from a table

b)

Groups rows that have the same values into summary rows

c)

Inserts new rows into a table

d)

Restricts the number of rows returned by a query

25.

What is the purpose of the SQL keyword SELECT?

a)

Deletes data from a database

b)

Retrieves data from a database

c)

Inserts data into a database

d)

Updates data in a database

26.

Which SQL function is used to find the maximum value in a column?

a)

COUNT

b)

SUM

c)

MIN

d)

MAX

27.

What is the purpose of SQL LIMIT clause?

a)

Deletes duplicate rows from a table

b)

Groups rows that have the same values into summary rows

c)

Inserts new rows into a table

d)

Restricts the number of rows returned by a query

28.

What is the purpose of the SQL keyword HAVING?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Applies a filter condition to groups of rows

29.

Which SQL function is used to calculate the total number of rows in a table?

a)

AVG

b)

MAX

c)

COUNT

d)

SUM

30.

What is the purpose of the SQL keyword LIKE?

a)

Deletes records from a table

b)

Updates existing records in a table

c)

Inserts new records into a table

d)

Performs pattern matching on a column value

31.

What is the purpose of the SQL keyword BETWEEN?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Checks if a value is within a range

32.

Which SQL function is used to find the total number of distinct values in a column?

a)

AVG

b)

MAX

c)

COUNT DISTINCT

d)

SUM

33.

What is the purpose of the SQL keyword JOIN?

a)

Deletes records from a table

b)

Updates existing records in a table

c)

Combines rows from two or more tables based on a related column between them

d)

Retrieves data from a database

34.

What is the purpose of the SQL keyword ORDER BY?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Applies a filter condition to groups of rows

35.

Which SQL function is used to calculate the average value in a column?

a)

MAX

b)

SUM

c)

MIN

d)

AVG

36.

What is the purpose of the SQL keyword GROUP BY?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Applies a filter condition to groups of rows

37.

What is the purpose of the SQL keyword DISTINCT?

a)

Deletes duplicate rows from a table

b)

Groups rows that have the same values into summary rows

c)

Inserts new rows into a table

d)

Retrieves unique records from a result set

38.

Which SQL function is used to find the minimum value in a column?

a)

COUNT

b)

SUM

c)

MIN

d)

MAX

39.

What is the purpose of the SQL keyword WHERE?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Applies a filter condition to groups of rows

40.

What is the purpose of the SQL keyword WHERE?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Groups records based on a column

d)

Joins two or more tables based on a related column

41.

Which SQL function is used to find the total number of rows in a table?

a)

AVG

b)

MAX

c)

COUNT

d)

SUM

42.

What is the purpose of the SQL keyword DISTINCT?

a)

Deletes duplicate rows from a table

b)

Groups rows that have the same values into summary rows

c)

Inserts new rows into a table

d)

Retrieves unique records from a result set

43.

What is the purpose of the SQL keyword UPDATE?

a)

Updates existing records in a table

b)

Deletes records from a table

c)

Inserts new records into a table

d)

Retrieves data from a database

44.

Which SQL function is used to calculate the average value in a column?

a)

COUNT

b)

MAX

c)

MIN

d)

AVG

45.

What is the purpose of SQL DISTINCT keyword?

a)

Filters records based on conditions

b)

Sorts the result set in ascending or descending order

c)

Selects unique records from a table

d)

Groups records based on a column