NEW
Font size
Worksheetssql
Total questions: 24
Worksheet time: 23mins
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
What does SQL stand for?
Standard Query Language
Sequential Query Language
Structured Question Language
Structured Query Language
Match the following SQL term with a description - FROM
The criteria which must be met
The fields to display
The field and order used to sort the results
The table used in the query
In what order does SQL process the instructions?
FROM - SELECT - WHERE - ORDER BY
WHERE - FROM - SELECT - ORDER BY
SELECT - FROM - WHERE - ORDER BY
SELECT - FROM - ORDER By - WHERE
Which statement is used to extract data from a database?
Extract
Get
Open
Select
Less than or equal to?
>=
=>
=<
<=
A primary key can be NULL in the table? TRUE or FALSE
TRUE
FALSE
SQL is
Structured Query Language
Simple Query Language
Structured Question Language
Structure Quality Language
How many records are in this table?
7
6
5
4
How many fields are there?
4
5
6
7
Which field is the key field?
ID
Name
HighScore
Competition
What is the ID of the records that are returned when the SQL statement "SELECT * FROM Gymnasts WHERE Name='Xavier'"?
0001
0002
0003
0004
0005
Which of the following is NOT a SQL command?
SELECT
FROM
LIKE
SIMILAR
DISTINCT
How many fields are there in this table?
6
7
9
42
How many records would be returned by the following SQL "SELECT * FROM songs WHERE Length < 3 AND Protected = True"?
0
2
3
4
If you were wanting to filter data, which clause would you use?
Where
Order by
From
Select
Which character returns all the data found in a table?
%
#
*
/
Which word is missing from the following SQL statement?
Select * table_name
With
Where
From
And
What is the correct order of clauses in a SQL statement?
SELECT, FROM, ORDER BY, WHERE
SELECT, FROM, WHERE, ORDER BY
SELECT, WHERE, FROM, ORDER BY
WHERE, FROM, SELECT, ORDER BY
Which query would return only the fields DesignerID and Designer?
SELECT * FROM Designers
SELECT DesignerID, Name FROM Designers
SELECT DesignerID AND Designer FROM Designers
SELECT DesignerID, Designer FROM Designers
How would we script a SQL query to select "Description" from the Item table?
SELECT Item.Description
EXTRACT Description FROM Item
SELECT Item FROM Description
SELECT Description FROM Item
How would you display Chairs in the Items table that have a Price greater than £50.
SELECT * FROM Items WHERE Type = 'Chair' AND Price > 50
SELECT * FROM Items WHERE Type = 'Chair' OR Price < 100
SELECT * FROM Iterms WHERE Type = 'Chair' AND Price >= 50
SELECT * FROM Items WHERE Price > 50
Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70
SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70
With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
