wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL 2

Total questions: 14

Worksheet time: 7mins

Name
Class
Date
1.
What word is missing from the line below?
SELECT *
_______ CUSTOMER;
a)
FROM
b)
WHERE
c)
SELECT
d)
ORDER BY
2.

Drag the options into the correct boxes to complete the query

To display the detail of employee having "e" in their name in descending order of salary

SELECT * ​ (a)   emp ​ (b)   ename ​ (c)   %e%" ​ (d)   SAL ​ (e)   ;

Choose from the below words
FROM
WHERE
LIKE "
ORDER BY
DESC
3.

Which of the following queries is valid

a)

SELECT name, course_name FROM student WHERE age>50 and <80;   

b)

SELECT name, course_name FROM student WHERE age>50 and age <80;

c)

SELECT name, course_name FROM student WHERE age>50 and WHERE age<80;

d)

None of these

4.

In an SQL SELECT statement querying a single table, the asterisk (*) means that:

a)

All records are to be returned.

b)

None the options is correct.

c)

All fields of the table are to be returned

d)

All records meeting the full criteria are to be returned.

5.

How do we select all rows for the "Designer" table?

a)

SELECT * FROM Designer

b)

SELECT [All] FROM Designer

c)

SELECT Designer.*

d)

SELECT FROM Designer

6.

How would we script a SQL query to select "Description" from the Item table?

a)

SELECT Item.Description

b)

EXTRACT Description FROM Item

c)

SELECT Item FROM Description

d)

SELECT Description FROM Item

7.

Which query would return only the fields DesignerID and Designer?

a)

SELECT * FROM Designers

b)

SELECT DesignerID, Name FROM Designers

c)

SELECT DesignerID AND Designer FROM Designers

d)

SELECT DesignerID, Designer FROM Designers

8.

How would you display Chairs in the Items table that have a Price greater than £50.

a)

SELECT * FROM Items WHERE Type = 'Chair' AND Price > 50

b)

SELECT * FROM Items WHERE Type = 'Chair' OR Price < 100

c)

SELECT * FROM Iterms WHERE Type = 'Chair' AND Price >= 50

d)

SELECT * FROM Items WHERE Price > 50

9.

Match the following SQL term with a description - SELECT

a)

The fields to display

b)

The table used in the query

c)

The criteria which must be met

d)

The field and order used to sort the results

10.

Match the following SQL term with a description - WHERE

a)

The table used in the query

b)

The fields to display

c)

The field and order used to sort the results

d)

The criteria which must be set

11.

Match the following SQL term with a description - ORDER BY

a)

The fields to display

b)

The field and order used to sort the results

c)

The table used in the query

d)

The criteria that must be met

12.

Which symbol would you use to represent more than 50

a)

= 50

b)

< 50

c)

> 50

d)

# 50

13.

What would the SQL query pictured do?

a)

Find all the men

b)

Find all of the female writers

c)

Find all of Elgar's friends

d)

Find all the male writers

e)

Find all the fish

14.
What is missing in this code? SELECT * FROM WHERE genre = ‘action’ ORDER BY year ASC;
a)
Missing an AND
b)
Table name
c)
Capitalize action
d)
None of these