Font size
WorksheetsSQL Revision for Year 12
Total questions: 20
Worksheet time: 10mins
SQL is an acronym that stands for...
Structured Question Language
Standard Question Language
Structured Query Language
Standard Query Language
A relational database accesses information from one or more...
Spreadsheets
Collections
Matrices
Tables
The reserved syntax to create a table is...
CREATE TABLE <table name> (field_name DATATYPE...);
TABLE <table name> (field_name DATATYPE);
CREATE <table name> (field_name DATATYPE);
SELECT <fieldname> FROM <table name)
The SQL statement to retrieve information from a table uses..
CREATE TABLE <table name> (field_name DATATYPE...);
SELECT <field_name> FROM <table name>;
SELECT <table name> FROM <table name>;
CREATE DATABASE <database name>;
To restrict the retrieved rows using certain conditions we use which SQL clause?
WHERE <condition>
WHEN <condition>
THAT <condition>
WITH <condition>
When examining a row in a table, we refer to it as a...
row number
result number
record
result
When examining a column in a table, we refer to it as a...
field name
folder name
column number
table name
When defining a table, each field name has both a ...
table name and a database
command and an argument
goal and a purpose
name and a data type
A primary key ensures that each value stored is...
unique
spelled correctly
meaningful
colourful
To make a WHERE clause to express that two criterias both must be satisfied, we use the _________ statement
OR
MAYBE
AND
BOTH
For a WHERE clause to express that at least one of two criterias must be satisfied, we use the __________ statement
AND
EITHER
ONE OF
OR
In order to specify where the fieldname comes from when joining tables, we need to use which of the following notations:
fieldname.tablename
tablename.fieldname
When searching in a range of values you can use either...
"BETWEEN.. AND.. " or "(x < y) AND (x > z)"
"OR" or "JOIN"
"LIKE" or "HAVING"
"GROUP BY" or "ORDER BY"
What aggregate function finds the smallest value in the given conditions of a query?
COUNT
MAX
MIN
AVG
What is the term used to describe the inclusion of another SQL query to set the conditional statement value?
subset
subcondition
subquery
conditional statement
When using an aggregate function what is the only way to retrieve more than one result for that field name?
Use a GROUP BY statement
Use a conditional statement in the WHERE clause
Use multiple field names
ORDER BY the information
Which of the following explains a reason to use a 'wildcard' in the WHERE clause?
When the spelling of the value stored isn't quite known.
When you want to find all results beginning with the same letter
When you want to count the number of entries under the fieldname
When you want to check if a certain letter configuration exists anywhere in the value stored in that field name
Which join type will find ONLY the records that match from BOTH tables?
INNER JOIN
JOIN
OUTER LEFT JOIN
OUTER RIGHT JOIN
Which join types allows a null value to exist when there is no matching criteria on the join?
INNER JOIN
JOIN
LEFT OUTER JOIN
RIGHT OUTER JOIN
What is the problem when using a simple cross join (SELECT..FROM..JOIN...)
Some information is left missing as only the matching values in both tables are displayed
Null values are inserted where there is no matching value in the join
For every record of the first table a new record is created for every row in the second table making the information unmeaningful.
