wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Revision for Year 12

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

SQL is an acronym that stands for...

a)

Structured Question Language

b)

Standard Question Language

c)

Structured Query Language

d)

Standard Query Language

2.

A relational database accesses information from one or more...

a)

Spreadsheets

b)

Collections

c)

Matrices

d)

Tables

3.

The reserved syntax to create a table is...

a)

CREATE TABLE <table name> (field_name DATATYPE...);

b)

TABLE <table name> (field_name DATATYPE);

c)

CREATE <table name> (field_name DATATYPE);

d)

SELECT <fieldname> FROM <table name)

4.

The SQL statement to retrieve information from a table uses..

a)

CREATE TABLE <table name> (field_name DATATYPE...);

b)

SELECT <field_name> FROM <table name>;

c)

SELECT <table name> FROM <table name>;

d)

CREATE DATABASE <database name>;

5.

To restrict the retrieved rows using certain conditions we use which SQL clause?

a)

WHERE <condition>

b)

WHEN <condition>

c)

THAT <condition>

d)

WITH <condition>

6.

When examining a row in a table, we refer to it as a...

a)

row number

b)

result number

c)

record

d)

result

7.

When examining a column in a table, we refer to it as a...

a)

field name

b)

folder name

c)

column number

d)

table name

8.

When defining a table, each field name has both a ...

a)

table name and a database

b)

command and an argument

c)

goal and a purpose

d)

name and a data type

9.

A primary key ensures that each value stored is...

a)

unique

b)

spelled correctly

c)

meaningful

d)

colourful

10.

To make a WHERE clause to express that two criterias both must be satisfied, we use the _________ statement

a)

OR

b)

MAYBE

c)

AND

d)

BOTH

11.

For a WHERE clause to express that at least one of two criterias must be satisfied, we use the __________ statement

a)

AND

b)

EITHER

c)

ONE OF

d)

OR

12.

In order to specify where the fieldname comes from when joining tables, we need to use which of the following notations:

a)

fieldname.tablename

b)

tablename.fieldname

13.

When searching in a range of values you can use either...

a)

"BETWEEN.. AND.. " or "(x < y) AND (x > z)"

b)

"OR" or "JOIN"

c)

"LIKE" or "HAVING"

d)

"GROUP BY" or "ORDER BY"

14.

What aggregate function finds the smallest value in the given conditions of a query?

a)

COUNT

b)

MAX

c)

MIN

d)

AVG

15.

What is the term used to describe the inclusion of another SQL query to set the conditional statement value?

a)

subset

b)

subcondition

c)

subquery

d)

conditional statement

16.

When using an aggregate function what is the only way to retrieve more than one result for that field name?

a)

Use a GROUP BY statement

b)

Use a conditional statement in the WHERE clause

c)

Use multiple field names

d)

ORDER BY the information

17.

Which of the following explains a reason to use a 'wildcard' in the WHERE clause?

a)

When the spelling of the value stored isn't quite known.

b)

When you want to find all results beginning with the same letter

c)

When you want to count the number of entries under the fieldname

d)

When you want to check if a certain letter configuration exists anywhere in the value stored in that field name

18.

Which join type will find ONLY the records that match from BOTH tables?

a)

INNER JOIN

b)

JOIN

c)

OUTER LEFT JOIN

d)

OUTER RIGHT JOIN

19.

Which join types allows a null value to exist when there is no matching criteria on the join?

a)

INNER JOIN

b)

JOIN

c)

LEFT OUTER JOIN

d)

RIGHT OUTER JOIN

20.

What is the problem when using a simple cross join (SELECT..FROM..JOIN...)

a)

Some information is left missing as only the matching values in both tables are displayed

b)

Null values are inserted where there is no matching value in the join

c)

For every record of the first table a new record is created for every row in the second table making the information unmeaningful.