Font size
WorksheetsSQL Keywords
Total questions: 55
Worksheet time: 46mins
The primary key of a table which is present in another table for referencing is known as (a)
The command which changes the structure of a table is (a)
Which is not an aggregate function?
SUM()
POW()
AVG()
COUNT()
A ______________ is a computerized record keeping that enables you to create, modify, store, and extract information from a database.
Data Bin Management System
Data Base Management Server
Data Base Management System
A ____________ refers to the data files that contains records, which have a small, fixed number of fields, without any structured relationship.
Flat file database
Relational database
Which of the following is not an example of relational database?
Oracle
MS Access
MS Excel
MS SQL
A database stores a vast amount of data, but _____________ helps us to retrieve the filtered data based upon some conditions.
forms
reports
queries
______________ is the most popular and powerful Relational Database Management System(RDBMS) that serves as an integral part of the MS Office Suite Application.
MS Word
MS Excel
MS Access
MS OneDrive
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
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
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')
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
A Relational database management system (RDBMS) is a database management system (DBMS) that is based on the relational model.
True
False
In order to modify data in a database we would use which SQL statement?
Update
Amend
Alter
Modify
Less than or equal to?
>=
=>
=<
<=
Which word is missing from the following SQL statement?
Select * table_name
With
Where
From
And
How do we select all rows for the "Designer" table?
SELECT * FROM Designer
SELECT [All] FROM Designer
SELECT Designer.*
SELECT FROM Designer
You are required to update the phone number for only the DesignerID "SMI01" in the "Designer" table. Which of these would successfully do that?
UPDATE Designer SET PhoneNo = '01224123456'
UPDATE Designer (PhoneNo) VALUES ('01224123456')
UPDATE Designer SET PhoneNo = '01224123456' WHERE DesignerID = 'SMI01'
UPDATE PhoneNo = '01224123456' FROM Designer WHERE DesignerID = 'SMI01'
What does the ALTER TABLE clause do?
The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints
The SQL ALTER TABLE clause is used to insert data into database table
THE SQL ALTER TABLE deletes data from database table
The SQL ALTER TABLE clause is used to delete a database table
The UPDATE SQL clause can _____________
update only one row at a time
update more than one row at a time
delete more than one row at a time
delete only one row at a time
How can you change “Hansen” into “Nilsen” in the “LastName” column in the Persons table?
UPDATE Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
MODIFY Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
MODIFY Persons SET LastName=’Hansen’ INTO LastName=’Nilsen’
UPDATE Persons SET LastName=’Nilsen’ WHERE LastName=’Hansen’
Which would find pupils with "er" anywhere in their name?
SELECT * FROM Pupils Where Name = "%er"
SELECT * FROM Pupils Where Name = "$er$"
SELECT * FROM Pupils Where Name = "%er%"
SELECT * FROM Pupils Where Name = "er%"
9. ___________ are the values given to make the clause complete.
Keywords
Clauses
Arguments
Commands
A SELECT statement comes in four main parts:
SELECT
FROM
WHERE
INPUT
ORDER BY
FROM specifies ...................................
the information you want to find within the database
the table(s) that contain(s) the information
the criteria you need to find the information
how the data is organized (sorted) when it is retrieved.
WHERE specifies ...................................
the criteria you need to find the information
the table(s) that contain(s) the information
the information you want to find within the database
how the data is organized (sorted) when it is retrieved.
ORDER BY specifies ...................................
the criteria you need to find the information
the table(s) that contain(s) the information
the information you want to find within the database
how the data is organized (sorted) when it is retrieved.
The SQL INSERT statement has the following structure:
INSERT INTO
Table (field1, field2, field3, …)
VALUES
(value1, value2, value3, …)
INSERT INTO
Table (table1, table2, table3, …)
VALUES
(value1, value2, value3, …)
INSERT INTO
Table (table1, table2, table3, …)
VALUES
(field1, field2, field3, …)
INSERT INTO
Table (field1, field2, field3, …)
VALUES
(record1, record2, record3, …)
The SQL keywords/commands must be always in capital letters
False
True
The purpose of SELECT * FROM Pupils WHERE Result>90 is
To set every Pupil’s result to 90
To retrieve a collection of records of Pupils but only those whose result is 90
To retrieve a collection of records of Pupils but only those whose result is over 90
To retrieve a collection of records of Pupils but only those whose name is over 90
This symbol is placed immediately after the SELECT command to display all the fields.
$
%
=
*
The number of rows in a relation
degree
tuple
cardinality
domain
Which of the following is the correct order of keywords for SQL SELECT statements?
SELECT, FROM, WHERE
FROM, WHERE, SELECT
WHERE, FROM,SELECT
SELECT,WHERE,FROM
