Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Quiz

Total questions: 40

Worksheet time: 55mins

Name
Class
Date
1.

What does SQL stand for?

a)

Simple Query Language

b)

Structured Query Language

c)

Standard Query Language

d)

Sequential Query Logic

2.

In which decade was SQL first developed by IBM researchers?

a)

1960s

b)

1970s

c)

1980s

d)

1990s

3.

Which type of database does SQL primarily interact with?

a)

Hierarchical Database

b)

Flat File Database

c)

Relational Database

d)

NoSQL Database

4.

Which SQL command is used to retrieve data from a table?

a)

FETCH

b)

GET

c)

EXTRACT

d)

SELECT

5.

Which category of SQL commands deals with defining or modifying the structure of the database?

a)

DML

b)

DDL

c)

DQL

d)

DCL

6.

Which of the following is an example of a DML (Data Manipulation Language) command?

a)

CREATE

b)

ALTER

c)

UPDATE

d)

DROP

7.

What character is used to terminate a standard SQL statement?

a)

Colon (:)

b)

Period (.)

c)

Semicolon (;)

d)

Comma (,)

8.

To filter results in a SELECT statement, which clause is used?

a)

WHERE

b)

HAVING

c)

GROUP BY

d)

ORDER BY

9.

Which command is used to add new rows of data into a table?

a)

ADD

b)

INSERT INTO

c)

NEW ROW

d)

UPDATE

10.

The unique identifier for each record in a table is called the:

a)

Foreign Key

b)

Secondary Key

c)

Primary Key

d)

Master Key

11.

Which clause is used to sort the result-set in ascending or descending order?

a)

SORT BY

b)

ORDER BY

c)

ALIGN

d)

SEQUENCE

12.

What does 'DCL' stand for in SQL?

a)

Data Central Language

b)

Data Control Language

c)

Database Control Logic

d)

Data Command List

13.

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

a)

SUM()

b)

TOTAL()

c)

COUNT()

d)

ADD()

14.

In SQL syntax, keywords like SELECT and FROM are:

a)

Case-sensitive

b)

Case-insensitive

c)

Always lowercase

d)

Always bolded

15.

Which command is used to remove a column or a whole table structure from the database?

a)

DELETE

b)

REMOVE

c)

DROP

d)

TRUNCATE

16.

True or False: SQL is a procedural language.

a)

True

b)

False

17.

True or False: Tables in a relational database are also known as 'relations.'

a)

True

b)

False

18.

True or False: The GROUP BY clause is typically used with aggregate functions.

a)

True

b)

False

19.

True or False: CHAR is a variable-length data type, while VARCHAR is fixed-length.

a)

True

b)

False

20.

True or False: Data integrity rules in SQL help prevent duplicate or inconsistent data.

a)

True

b)

False

21.

True or False: The DELETE command removes the table structure from the database.

a)

True

b)

False

22.

True or False: A relational database stores data in a flat-file format.

a)

True

b)

False

23.

True or False: SQL can be used to set permissions for different users (DCL).

a)

True

b)

False

24.

True or False: In SQL, 1 usually represents TRUE and 0 represents FALSE.

a)

True

b)

False

25.

True or False: SQL is platform-dependent and only works on Windows systems.

a)

True

b)

False

26.

What is the term for a single entry (row) in a table?

4 lines
27.

Which specific clause is used to filter groups of data after they have been aggregated?

4 lines
28.

What is the name for the number of attributes (columns) in a relation?

4 lines
29.

Which SQL command is used to save all changes made during a transaction?

4 lines
30.

What type of 'Join' returns all records when there is a match in either the left or right table?

4 lines
31.

Identify the command category for GRANT and REVOKE.

4 lines
32.

What keyword is used in a SELECT statement to return only unique (non-duplicate) values?

4 lines
33.

Which aggregate function returns the average value of a numeric column?

4 lines
34.

What term describes the number of tuples (rows) in a relation?

4 lines
35.

Which operator is used for pattern matching (e.g., finding names starting with 'A')?

4 lines
36.

Identify the DDL command used to change the structure of an existing table.

4 lines
37.

What does 'TCL' stand for in the context of SQL commands?

4 lines
38.

Which data type would you use for a column storing large whole numbers?

4 lines
39.

What is the name of the operation used to combine data from two tables based on a common column?

4 lines
40.

Fill in the blank: The (a)   command is used to undo changes that have not yet been saved to the database.