Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

yuusql

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.
Question 1: What does SQL stand for?
a)
Strong Question Language
b)
Structured Query Language
c)
Structured Question Language
2.
Question 2: Which SQL statement is used to extract data from a database?
a)
OPEN
b)
SELECT
c)
GET
d)
EXTRACT
3.
Question 3: Which SQL statement is used to update data in a database?
a)
SAVE AS
b)
MODIFY
c)
UPDATE
d)
SAVE
4.
Question 4: Which SQL statement is used to delete data from a database?
a)
COLLAPSE
b)
REMOVE
c)
DELETE
5.
Question 5: Which SQL statement is used to insert new data in a database?
a)
ADD NEW
b)
ADD RECORD
c)
INSERT INTO
d)
INSERT NEW
6.
Question 6: With SQL, how do you select a column named "FirstName" from a table named "Persons"?
a)
EXTRACT FirstName FROM Persons
b)
SELECT Persons.FirstName
c)
SELECT FirstName FROM Persons
7.
Question 7: With SQL, how do you select all the columns from a table named "Persons"?
a)
SELECT * FROM Persons
b)
SELECT Persons
c)
SELECT [all] FROM Persons
d)
SELECT *.Persons
8.
Question 8: With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
a)
SELECT * FROM Persons WHERE FirstName='Peter'
b)
SELECT * FROM Persons WHERE FirstName<>'Peter'
c)
SELECT [all] FROM Persons WHERE FirstName LIKE 'Peter'
d)
SELECT [all] FROM Persons WHERE FirstName='Peter'
9.
Question 9: With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
a)
SELECT * FROM Persons WHERE FirstName LIKE 'a%'
b)
SELECT * FROM Persons WHERE FirstName LIKE '%a'
c)
SELECT * FROM Persons WHERE FirstName='a'
d)
SELECT * FROM Persons WHERE FirstName='%a%'
10.
Question 10: The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
a)
True
b)
False
11.
Question 11: With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
a)
SELECT * FROM Persons WHERE FirstName='Peter' AND LastName='Jackson'
b)
SELECT FirstName='Peter', LastName='Jackson' FROM Persons
c)
SELECT * FROM Persons WHERE FirstName<>'Peter' AND LastName<>'Jackson'
12.
Question 12: With SQL, how do you select all the records from a table named "Persons" where the "LastName" is alphabetically between (and including) "Hansen" and "Pettersen"?
a)
SELECT * FROM Persons WHERE LastName BETWEEN 'Hansen' AND 'Pettersen'
b)
SELECT * FROM Persons WHERE LastName>'Hansen' AND LastName<'Pettersen'
c)
SELECT LastName>'Hansen' AND LastName<'Pettersen' FROM Persons
13.
Question 13: Which SQL statement is used to return only different values?
a)
SELECT DISTINCT
b)
SELECT DIFFERENT
c)
SELECT UNIQUE
14.
Question 14: Which SQL keyword is used to sort the result-set?
a)
SORT
b)
ORDER
c)
SORT BY
d)
ORDER BY
15.
Question 15: With SQL, how can you return all the records from a table named "Persons" sorted descending by "FirstName"?
a)
SELECT * FROM Persons SORT BY 'FirstName' DESC
b)
SELECT * FROM Persons ORDER BY FirstName DESC
c)
SELECT * FROM Persons ORDER FirstName DESC
d)
SELECT * FROM Persons SORT 'FirstName' DESC
16.
Question 16: With SQL, how can you insert a new record into the "Persons" table?
a)
INSERT VALUES ('Jimmy', 'Jackson') INTO Persons
b)
INSERT ('Jimmy', 'Jackson') INTO Persons
c)
INSERT INTO Persons VALUES ('Jimmy', 'Jackson')
17.
Question 17: With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?
a)
INSERT INTO Persons (LastName) VALUES ('Olsen')
b)
INSERT INTO Persons ('Olsen') INTO LastName
c)
INSERT ('Olsen') INTO Persons (LastName)
18.
Question 18: How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table?
a)
UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'
b)
MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'
c)
UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'
d)
MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen
19.
Question 19: With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?
a)
DELETE FirstName='Peter' FROM Persons
b)
DELETE FROM Persons WHERE FirstName = 'Peter'
c)
DELETE ROW FirstName='Peter' FROM Persons
20.
Question 20: With SQL, how can you return the number of records in the "Persons" table?
a)
SELECT COUNT(*) FROM Persons
b)
SELECT COLUMNS(*) FROM Persons
c)
SELECT LEN(*) FROM Persons
d)
SELECT NO(*) FROM Persons
21.
Question 21: What is the most common type of join?
a)
JOINED
b)
JOINED TABLE
c)
INSIDE JOIN
d)
INNER JOIN
22.
Question 22: Which operator is used to select values within a range?
a)
BETWEEN
b)
RANGE
c)
WITHIN
23.
Question 23: The NOT NULL constraint enforces a column to not accept NULL values.
a)
False
b)
True
24.
Question 24: Which operator is used to search for a specified pattern in a column?
a)
FROM
b)
GET
c)
LIKE
25.
Question 25: Which SQL statement is used to create a database table called 'Customers'?
a)
CREATE TABLE Customers
b)
CREATE DATABASE TABLE Customers
c)
CREATE DB Customers
d)
CREATE DATABASE TAB Customers