Font size
WorksheetsSQL Keywords Quiz
Total questions: 20
Worksheet time: 12mins
What does "SQL" stand for?
Structured Question Language
Structured Query Language
Simple Query Language
Simple Question Language
Which statement is used to extract data from a database?
Extract
Get
Open
Select
If you were wanting to filter data, which clause would you use?
Where
Order by
From
Select
Using which word allows you to specify that more than one condition must be met in a query?
Also
And
Or
Where
Using which word allows you to specify that only one of a series of conditions needs to be met in a query filter?
And
Maybe
If
Or
Which statement allows us to add a record to a table?
Add To
Update To
Add Into
Insert Into
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
DDL means
(a)
DML
(a)
Which SQL statement would add a record to the database?
INSERT INTO Designer VALUES ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456')
INSERT VALUES ('SMI01', 'M Smith', 'mail@msmith.com', 01224123456') INTO Designer
INSERT ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456') INTO Designer
INSERT Designer INTO VALUES (''SMI01', 'M Smith', 'mail@msmith.com', '01224123456')
______________ constraint prevents NULL values
UNIQUE
NOT NULL
NULL
FOREIGN KEY
A primary key can be NULL in the table? TRUE or FALSE
TRUE
FALSE
What would the SQL query pictured do?
Find all the men
Find all of the female writers
Find all of Elgar's friends
Find all the male writers
Find all the fish
Which of the queries is most likely to have produced this result?
ANSWER: SELECT id, name, year FROM movies WHERE year > 2010;
ANSWER: SELECT id, name, year FROM movies WHERE year < 2010;
ANSWER: SELECT * FROM movies WHERE year > 2010;
ANSWER: SELECT id, name, year FROM movies WHERE YEAR > 2010;
What is a ‘tuple’?
A row or record in a database table
Another name for the key linking different tables in a database.
An attribute attached to a record.
Another name for a table in an RDBMS.
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
SELECT [all] FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName='Peter'
SELECT * FROM Persons WHERE FirstName<>'Peter'
With SQL, how can you insert a new record into the "Persons" table?
INSERT ('Jimmy', 'Jackson') INTO Persons
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
Which of the following is a property of database
Represents some aspect of the real world
Logically related collection of data
Built, and populated with data for a specific purpose
All the above
A database management system (DBMS) is a collection of programs that enables users to
create a database
manipulate a database
both create and manipulate a database
for storing data only
If every non-key attribute is functionally dependent on the primary key, then the relation will be in :
1NF
2NF
3NF
4NF
