wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SQL Quiz

Total questions: 30

Worksheet time: 15mins

Name
Class
Date
1.

Which of the following is not a DDL command?

a)

TRUNCATE

b)

ALTER

c)

CREATE

d)

UPDATE

2.

Which statement is used to delete all rows in a table without having the action logged?

a)

DELETE

b)

DROP

c)

TRUNCATE

d)

REMOVE

3.

SQL Views are also known as

a)

Simple Tables

b)

Virtual Tables

c)

Complex Tables

d)

Actual Tables

4.

Which of the following is not Constraint in SQL?

a)

Not Null

b)

Check

c)

Union

d)

Primary Key

5.

Which of the following is not a valid aggregate function?

a)

SUM

b)

MAX

c)

COMPUTE

d)

COUNT

6.

Which data manipulation command is used to combines the records from one or more tables?

a)

SELECT

b)

PROJECT

c)

JOIN

d)

PRODUCT

7.

Which operator is used to compare a value to a specified list of values?

a)

IN

b)

ALL

c)

BETWEEN

d)

ANY

8.

What operator tests column for absence of data

a)

NOT operator

b)

EXISTS operator

c)

IS NULL operator

d)

! (NOT operator)

9.

In which of the following cases a DML statement is not executed?

a)

When existing rows are modified.

b)

When a table is deleted.

c)

When some rows are deleted.

d)

All of these

10.

If we have not specified ASC or DESC after a SQL ORDER BY clause, the following is used by default

a)

DESC

b)

ASC

c)

Query will not run

d)

There is no default value

11.

Which of the following is true about the HAVING clause?

a)

Similar to the WHERE clause but is used for columns rather than groups.

b)

Similar to WHERE clause but is used for rows rather than columns.

c)

Similar to WHERE clause but is used for groups rather than rows.

d)

Acts exactly like a WHERE clause.

12.

_________ command makes the updates performed by the transaction permanent in the database?

a)

COMMIT

b)

ROLLBACK

c)

SAVE

d)

RECORD

13.

Which command is used to change the definition of a table in SQL?

a)

CREATE

b)

ALTER

c)

UPDATE

d)

CHANGE

14.

Which type of JOIN is used to returns rows that do not have matching values?

a)

INNER JOIN

b)

OUTER JOIN

c)

EQUI JOIN

d)

THETA JOIN

15.

Which of the following is the correct order of a SQL statement?

a)

SELECT, GROUP BY, WHERE, HAVING

b)

SELECT, WHERE, GROUP BY, HAVING

c)

SELECT, HAVING, WHERE, GROUP BY

d)

SELECT, WHERE, HAVING, GROUP BY

16.

What is the difference between a PRIMARY KEY and a UNIQUE KEY?

a)

Primary key can store null value, whereas a unique key cannot store null value.

b)

We can have only one primary key in a table while we can have multiple unique keys

c)

Primary key cannot be a date variable whereas unique key can be

d)

No difference at all. Both are same.

17.

______ is NOT a type of constraint in SQL language?

a)

Foreign Key

b)

Primary Key

c)

Unique

d)

Alternate Key

18.

Which statement is used to get all data from the student table whose name starts with p?

a)

SELECT * FROM student WHERE name LIKE '%p%';

b)

SELECT * FROM student WHERE name LIKE 'p%';

c)

SELECT * FROM student WHERE name LIKE '_p%';

d)

SELECT * FROM student WHERE name LIKE '%p';

19.

The command to remove rows from a table 'CUSTOMER' is:

a)

REMOVE FROM CUSTOMER ...

b)

DROP FROM CUSTOMER ...

c)

DELETE FROM CUSTOMER WHERE ...

d)

UPDATE FROM CUSTOMER ...

20.

The SQL WHERE clause:

a)

limits the column data that are returned.

b)

limits the row data are returned.

c)

Find the location of Row in a table

d)

Find the location of Column in a table

21.

The wildcard in a WHERE clause is useful when?

a)

An exact match is necessary in a SELECT statement.

b)

An exact match is not possible in a SELECT statement.

c)

An exact match is necessary in a CREATE statement.

d)

An exact match is not possible in a CREATE statement.

22.

 

The SQL keyword(s) ________ is used with wildcards.

a)

LIKE only

b)

IN only

c)

NOT IN only

d)

IN and NOT IN

23.

The result of a SQL SELECT statement is a(n) ________ .

a)

Report

b)

Form

c)

File

d)

Table

24.

Which of the following are the five built-in functions provided by SQL?

a)

COUNT, SUM, AVG, MAX, MIN

b)

SUM, AVG, MIN, MAX, MULT

c)

SUM, AVG, MULT, DIV, MIN

d)

SUM, AVG, MIN, MAX, NAME

25.

 

To remove duplicate rows from the results of an SQL SELECT statement, the ________ qualifier specified must be included.

a)

ONLY

b)

UNIQUE

c)

DISTINCT

d)

SINGLE

26.

Which of the following do you need to consider when you make a table in SQL?

a)

Data Types

b)

Primary Key

c)

Default Values

d)

All of these

27.

Which one of the following sorts rows in SQL?

a)

SORT BY

b)

ALIGN BY

c)

ORDER BY

d)

GROUP BY

28.

The SQL statement that queries or reads data from a table is ________ .

a)

SELECT

b)

READ

c)

QUERY

d)

None of these

29.

The SQL keyword BETWEEN is used:

a)

For ranges

b)

To limit the columns displayed.

c)

As a wildcard

d)

None of these

30.

SQL is:

a)

a programming language.

b)

an operating system.

c)

a data sublanguage

d)

a DBMS