wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Keywords

Total questions: 55

Worksheet time: 46mins

Name
Class
Date
1.

The primary key of a table which is present in another table for referencing is known as (a)  

2.

The command which changes the structure of a table is (a)  

3.

Which is not an aggregate function?

a)

SUM()

b)

POW()

c)

AVG()

d)

COUNT()

4.

A ______________ is a computerized record keeping that enables you to create, modify, store, and extract information from a database.

a)

Data Bin Management System

b)

Data Base Management Server

c)

Data Base Management System

5.

A ____________ refers to the data files that contains records, which have a small, fixed number of fields, without any structured relationship.

a)

Flat file database

b)

Relational database

6.

Which of the following is not an example of relational database?

a)

Oracle

b)

MS Access

c)

MS Excel

d)

MS SQL

7.

A database stores a vast amount of data, but _____________ helps us to retrieve the filtered data based upon some conditions.

a)

forms

b)

reports

c)

queries

8.

______________ is the most popular and powerful Relational Database Management System(RDBMS) that serves as an integral part of the MS Office Suite Application.

a)

MS Word

b)

MS Excel

c)

MS Access

d)

MS OneDrive

9.

Which statement is used to extract data from a database?

a)

Extract

b)

Get

c)

Open

d)

Select

10.

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

a)

Where

b)

Order by

c)

From

d)

Select

11.

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

a)

Add To

b)

Update To

c)

Add Into

d)

Insert Into

12.

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

13.

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')

14.

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

a)

TRUE

b)

FALSE

15.

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

16.

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;

17.

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.

18.

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'

19.

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')

20.

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

21.

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

22.

A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model.

a)

True

b)

False

23.

In order to modify data in a database we would use which SQL statement?

a)

Update

b)

Amend

c)

Alter

d)

Modify

24.

Less than or equal to?

a)

>=

b)

=>

c)

=<

d)

<=

25.

Which word is missing from the following SQL statement?


Select * table_name

a)

With

b)

Where

c)

From

d)

And

26.

How do we select all rows for the "Designer" table?

a)

SELECT * FROM Designer

b)

SELECT [All] FROM Designer

c)

SELECT Designer.*

d)

SELECT FROM Designer

27.

You are required to update the phone number for only the DesignerID "SMI01" in the "Designer" table. Which of these would successfully do that?

a)

UPDATE Designer SET PhoneNo = '01224123456'

b)

UPDATE Designer (PhoneNo) VALUES ('01224123456')

c)

UPDATE Designer SET PhoneNo = '01224123456' WHERE DesignerID = 'SMI01'

d)

UPDATE PhoneNo = '01224123456' FROM Designer WHERE DesignerID = 'SMI01'

28.

What does the ALTER TABLE clause do?

a)

The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints

b)

The SQL ALTER TABLE clause is used to insert data into database table

c)

THE SQL ALTER TABLE deletes data from database table

d)

The SQL ALTER TABLE clause is used to delete a database table

29.

The UPDATE SQL clause can _____________

a)

update only one row at a time

b)

update more than one row at a time

c)

delete more than one row at a time

d)

delete only one row at a time

30.

How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?

a)

UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

b)

MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

c)

MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’

d)

UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’

31.

Which would find pupils with "er" anywhere in their name?

a)

SELECT * FROM Pupils Where Name = "%er"

b)

SELECT * FROM Pupils Where Name = "$er$"

c)

SELECT * FROM Pupils Where Name = "%er%"

d)

SELECT * FROM Pupils Where Name = "er%"

32.
Return all dramas made after 2004.
a)
SELECT * FROM movies WHERE genre = 'drama';
b)
SELECT * FROM movies WHERE genre = 'drama' AND year > 2004;
c)
SELECT * FROM movies WHERE genre = "drama' AND year < 2004;
d)
SELECT * FROM movies WHERE imdb_rating = 7 AND LIMIT = 7
33.
What Query view is shown in this image?
a)
Datasheet View
b)
Design View
34.
What Query view is shown in this image?
a)
Datasheet View
b)
Design View
35.
What is letter "B" showing?
a)
Where to click to Run the Query
b)
Where to Configure the Fields returned and criteria to be used
c)
Where to click to configure the Join properties
d)
Where to click to Save this Query
36.
What is letter "C" showing?
a)
Where to click to Run the Query
b)
Where to Click to Save the Query
c)
Where to configure the Fields returned and the criteria to be used
d)
Where to configure the Join properties
37.
A query can get its data from
a)
a. one or more tables.
b)
b. existing queries.
c)
c. a combination of a and b.
d)
d. all of the above.
38.
A football team keeps a database about its players. Which query would allow them to produce a query showing players who are strikers and who have scored 20 goals or more?
a)
Position = "Striker" OR Goals = 20
b)
Position = "Striker" AND Goals = 20
c)
Position = "Striker" or Goals >=20
d)
Position = "Striker" AND Goals >= 20
39.
Wildcard that represents any collection of characters
a)
Asterisk
b)
Question Mark
c)
Query
d)
Equal Sign
40.
A bookshop owner is using the shop's database to help a customer.  The customer is looking for a particular author but cannot remember their full name.  The customer remembers that the surname of the author starts with the letters "Co".  What kind of query could the bookshop owner use to find this information?
a)
Parameter
b)
GroupBy
c)
Wildcard
d)
Selection
41.
A database entity is also known as:
a)
a table
b)
a field
c)
a row
d)
a report
42.
DBMS can summarise the data stored in the database and produce an easy to read _____:
a)
reports
b)
queries
c)
tables
d)
criteria
43.
Which of the following is the most important feature of DBMS:
a)
Command language like SQL
b)
Ability to back up data
c)
Ease of use
d)
Ability to automate some tasks
44.
Which of the following is not a DBMS despite having database capabilities:
a)
Microsoft Excel or similar spreadsheets
b)
Oracle
c)
MySQL
d)
Microsoft Access or similar
45.

9. ___________ are the values given to make the clause complete.

a)

Keywords

b)

Clauses

c)

Arguments

d)

Commands

46.

A SELECT statement comes in four main parts:

a)

SELECT

b)

FROM

c)

WHERE

d)

INPUT

e)

ORDER BY

47.

FROM specifies ...................................

a)

the information you want to find within the database

b)

the table(s) that contain(s) the information

c)

the criteria you need to find the information

d)

how the data is organized (sorted) when it is retrieved.

48.

WHERE specifies ...................................

a)

the criteria you need to find the information

b)

the table(s) that contain(s) the information

c)

the information you want to find within the database

d)

how the data is organized (sorted) when it is retrieved.

49.

ORDER BY specifies ...................................

a)

the criteria you need to find the information

b)

the table(s) that contain(s) the information

c)

the information you want to find within the database

d)

how the data is organized (sorted) when it is retrieved.

50.

The SQL INSERT statement has the following structure:

a)

INSERT INTO

Table (field1, field2, field3, …)

VALUES

(value1, value2, value3, …)

b)

INSERT INTO

Table (table1, table2, table3, …)

VALUES

(value1, value2, value3, …)

c)

INSERT INTO

Table (table1, table2, table3, …)

VALUES

(field1, field2, field3, …)

d)

INSERT INTO

Table (field1, field2, field3, …)

VALUES

(record1, record2, record3, …)

51.

The SQL keywords/commands must be always in capital letters

a)

False

b)

True

52.

The purpose of SELECT * FROM Pupils WHERE Result>90 is

a)

To set every Pupil’s result to 90

b)

To retrieve a collection of records of Pupils but only those whose result is 90

c)

To retrieve a collection of records of Pupils but only those whose result is over 90

d)

To retrieve a collection of records of Pupils but only those whose name is over 90

53.

This symbol is placed immediately after the SELECT command to display all the fields.

a)

$

b)

%

c)

=

d)

*

54.

The number of rows in a relation

a)

degree

b)

tuple

c)

cardinality

d)

domain

55.

Which of the following is the correct order of keywords for SQL SELECT statements?

a)

SELECT, FROM, WHERE

b)

FROM, WHERE, SELECT

c)

WHERE, FROM,SELECT

d)

SELECT,WHERE,FROM