wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Databases - Logic Operators

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.
The following query "SELECT * FROM Videos" can be interpreted as:
a)
Requesting to show all records stored in the table called Video.
b)
Deleting all records stored in the table called Video.
c)
Requesting to show all records with ID of 1 character stored in the table called Video.
2.
The following is not a valid SQL keyword:
a)
PRINT
b)
SELECT
c)
INSERT
d)
DELETE
3.
The following condition "!=" means:
a)
not equal
b)
always equal
c)
error
4.
The following is not a valid Logical keyword:
a)
EQUAL
b)
AND
c)
OR
d)
NOT
5.
To select all items in the above table costing over �100 and in stock, the following SQL statement is needed:
a)
SELECT * FROM Items WHERE Price>100 AND Quantity>0
b)
SELECT * FROM Items WHERE Price>100 OR Quantity>0
c)
INSERT * FROM Items WHERE Price>100 OR Quantity>0
d)
SELECT * FROM Items WHERE Price>=100 AND Quantity>=0
6.
A query to select both products from the same supplier would look like this:
a)
SELECT * FROM Items WHERE Supplier=205
b)
SELECT * FROM Items WHERE Supplier=Supplier
c)
SELECT * FROM Items WHERE Item="Socket m3" OR Item="Fuse 1A"
7.
The following query UPDATE Customers SET Price=Price*0.75, WHERE (Quantity>100 OR Price<30) AND OnSale=FALSE; will do this:
a)
For all non-sale items with over 100 units unsold, apply a 25% discount.
b)
Show all non-sale items with over 100 units unsold, priced 75p or lower.
c)
Take 75% off all overstocked items and mark them as non-sale items.
8.
AND operator is often replaced with NOT(OR)
a)
False
b)
True
9.
To select all items except "Socket m3", we could run the following query:
a)
SELECT * FROM Items WHERE NOT(ID=1001)
b)
SELECT * FROM Items WHERE NOT(ID="Socket m3")
c)
SELECT NOT(ID="Socket m3") FROM Items�
10.
AND, OR allow users to combine multiple ________ in querying a database:
a)
criteria
b)
tables
c)
records