Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Databases and SQL

Total questions: 30

Worksheet time: 30mins

Name
Class
Date
1.

SQL is

a)

Structured Query Language

b)

Simple Query Language

c)

Structured Question Language

d)

Structure Quality Language

2.

Less than or equal to?

a)

>=

b)

=>

c)

=<

d)

<=

3.

Which word is missing from the following SQL statement?


Select * table_name;

a)

With

b)

Where

c)

From

d)

And

4.

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

a)

$

b)

%

c)

=

d)

*

5.

Which statement is used to extract data from a database?

a)

Extract

b)

Get

c)

Open

d)

Select

6.

Greater than or equal to?

a)

>=

b)

=>

c)

=<

d)

<=

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.

What is the 'FROM' command used for?

a)

The criteria which must be met

b)

The fields to display

c)

The field and order used to sort the results

d)

The table used in the query

9.

What is the 'SELECT' command used for?

a)

The fields to display

b)

The table used in the query

c)

The criteria which must be met

d)

The field and order used to sort the results

10.

How is the 'WHERE' command used?

a)

The table used in the query

b)

The fields to display

c)

The field and order used to sort the results

d)

The criteria which must be set

11.

How is the 'ORDER BY' command used?

a)

The fields to display

b)

The field and order used to sort the results

c)

The table used in the query

d)

The criteria that must be met

12.

What is a field?

a)

A collection of information

b)

A single item of information

c)

A list of information

d)

A group of records

13.

Which symbol would you use to represent more than 50?

a)

= 50

b)

< 50

c)

> 50

d)

# 50

14.

How many records are in this table?

a)

7

b)

6

c)

5

d)

4

15.

How many fields are there?

a)

4

b)

5

c)

6

d)

7

16.

Which field is the key field?

a)

ID

b)

Name

c)

HighScore

d)

Competition

17.

Which ID is returned for the SQL statement?

SELECT * FROM Gymnasts WHERE Name='Xavier';

a)

0001

b)

0002

c)

0003

d)

0004

e)

0005

18.

How many records would be returned by the following SQL?

SELECT * FROM songs WHERE TimesPlayed >=3;

a)

0

b)

2

c)

3

d)

4

19.

How many records would be returned by the following SQL?

SELECT * FROM songs WHERE Length < 3 AND Protected = True;

a)

0

b)

2

c)

3

d)

4

20.

What is missing in this code?

SELECT * FROM WHERE genre = ‘action’ ORDER BY year ASC;

a)
Missing an AND
b)
Table name
c)
Capitalize action
d)
None of these
21.

Which statement will show all fields and records from the table called "celebs"?

a)

SELECT * FROM celebs;

b)

SELECT FROM celebs;

c)

SELECT forename, surname FROM celebs;

d)

SELECT celebs;

22.

The SQL statement being run is:


SELECT player_name, score FROM leaderboard;


What is the name of the table in this query?

a)

SELECT

b)

player_name

c)

score

d)

leaderboard

23.

The SQL statement being run is:


SELECT player_name, score FROM leaderboard;


How many columns of results will be shown when this query is run?

a)

0

b)

1

c)

2

d)

3

24.

Which SQL statement will show the names and heights of all basketball players taller than 200?

a)

SELECT name FROM Player WHERE height >200;

b)

SELECT name FROM Player WHERE height >=200;

c)

SELECT name, height FROM Player WHERE height >200;

d)

SELECT name, height FROM Player WHERE height <200;

25.

Which SQL statement will show the names and weights of all wrestlers lighter than 170?

a)

SELECT name, weight FROM Wrestler WHERE weight >170;

b)

SELECT name, weight FROM Wrestler WHERE weight <= 170;

c)

SELECT name, weight FROM Wrestler WHERE weight <170;

d)

SELECT name, weight FROM Wrestler WHERE weight >=170;

26.

Which character always appears at the end of a SQL statement?

a)

;

b)

:

c)

,

d)

.

27.

Which of these statements will show all wrestlers sorted from the heaviest to the lightest?

a)

SELECT * FROM Wrestler WHERE weight <170;

b)

SELECT * FROM Wrestler WHERE weight >170;

c)

SELECT * FROM Wrestler ORDER BY weight ASC;

d)

SELECT * FROM Wrestler ORDER BY weight DESC;

28.

Which of these statements will show all wrestlers in alphabetical order of their name

a)

SELECT * FROM Wrestler ORDER BY name ASC;

b)

SELECT * FROM Wrestler ORDER BY name DESC;

c)

SELECT * FROM Wrestler ORDER BY weight ASC;

d)

SELECT * FROM Wrestler ORDER BY weight DESC;

29.

Which SQL statement will show the names and heights of all basketball players sorted from smallest to tallest?

a)

SELECT name FROM Player ORDER BY height ASC;

b)

SELECT name FROM Player ORDER BY height DESC;

c)

SELECT name, height FROM Player ORDER BY height ASC;

d)

SELECT name, height FROM Player ORDER BY height DESC;

30.
Complete the following SQL query to find all records for surname = "Khan":
SELECT * FROM Customers ......
a)
surname = "Khan"
b)
WHERE surname = "Khan"
c)
AND surname = "Khan"
d)
WHEN surname = "Khan"