wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Keywords Quiz

Total questions: 20

Worksheet time: 12mins

Name
Class
Date
1.

What does "SQL" stand for?

a)

Structured Question Language

b)

Structured Query Language

c)

Simple Query Language

d)

Simple Question Language

2.

Which statement is used to extract data from a database?

a)

Extract

b)

Get

c)

Open

d)

Select

3.

If you were wanting to filter data, which clause would you use?

a)

Where

b)

Order by

c)

From

d)

Select

4.

Using which word allows you to specify that more than one condition must be met in a query?

a)

Also

b)

And

c)

Or

d)

Where

5.

Using which word allows you to specify that only one of a series of conditions needs to be met in a query filter?

a)

And

b)

Maybe

c)

If

d)

Or

6.

Which statement allows us to add a record to a table?

a)

Add To

b)

Update To

c)

Add Into

d)

Insert Into

7.

What is the correct order of clauses in a SQL statement?

a)

SELECT, FROM, ORDER BY, WHERE

b)

SELECT, FROM, WHERE, ORDER BY

c)

SELECT, WHERE, FROM, ORDER BY

d)

WHERE, FROM, SELECT, ORDER BY

8.

DDL means

(a)  

9.

DML

(a)  

10.

Which SQL statement would add a record to the database?

a)

INSERT INTO Designer VALUES ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456')

b)

INSERT VALUES ('SMI01', 'M Smith', 'mail@msmith.com', 01224123456') INTO Designer

c)

INSERT ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456') INTO Designer

d)

INSERT Designer INTO VALUES (''SMI01', 'M Smith', 'mail@msmith.com', '01224123456')

11.

______________ constraint prevents NULL values

a)

UNIQUE

b)

NOT NULL

c)

NULL

d)

FOREIGN KEY

12.

A primary key can be NULL in the table? TRUE or FALSE

a)

TRUE

b)

FALSE

13.

What would the SQL query pictured do?

a)

Find all the men

b)

Find all of the female writers

c)

Find all of Elgar's friends

d)

Find all the male writers

e)

Find all the fish

14.

Which of the queries is most likely to have produced this result?

a)

ANSWER: SELECT id, name, year FROM movies WHERE year > 2010;

b)

ANSWER: SELECT id, name, year FROM movies WHERE year < 2010;

c)

ANSWER: SELECT * FROM movies WHERE year > 2010;

d)

ANSWER: SELECT id, name, year FROM movies WHERE YEAR > 2010;

15.

What is a ‘tuple’?

a)

A row or record in a database table

b)

Another name for the key linking different tables in a database.

c)

An attribute attached to a record.

d)

Another name for a table in an RDBMS.

16.

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?

a)

SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'

b)

SELECT [all] FROM Persons WHERE FirstName='Peter'

c)

SELECT * FROM Persons WHERE FirstName='Peter'

d)

SELECT * FROM Persons WHERE FirstName<>'Peter'

17.

With SQL, how can you insert a new record into the "Persons" table?

a)

INSERT ('Jimmy', 'Jackson') INTO Persons

b)

INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

c)

INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

18.

Which of the following is a property of database

a)

Represents some aspect of the real world

b)

Logically related collection of data

c)

Built, and populated with data for a specific purpose

d)

All the above

19.

A database management system (DBMS) is a collection of programs that enables users to

a)

create a database

b)

manipulate a database

c)

both create and manipulate a database

d)

for storing data only

20.

If every non-key attribute is functionally dependent on the primary key, then the relation will be in :

a)

1NF

b)

2NF

c)

3NF

d)

4NF