wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

SQL Programming Revision

Total questions: 20

Worksheet time: 7mins

Name
Class
Date
1.

SQL Clause Used to Filter Aggregated Data is:

a)

WHERE

b)

GROUP BY

c)

HAVING

d)

ORDER BY

2.

SQL Tables do NOT exist on physical locations.

a)

TRUE

b)

FALSE

3.

Which SQL statement is used to extract data from a database?

a)

SELECT

b)

OPEN

c)

EXTRACT

d)

GET

4.

Which SQL statement is used to insert new data in a database?

a)

ADD RECORD

b)

ADD NEW

c)

INSERT NEW

d)

INSERT INTO

5.

Which SQL statement is used to return only different values?

a)

SELECT DIFFERENT

b)

SELECT UNIQUE

c)

SELECT DISTINCT

6.

With SQL, how can you insert a new record into the "Persons" table?

a)

INSERT VALUES ('JIMMY','JACKSON') INTO Persons

b)

INSERT INTO Persons VALUES ('JIMMY','JACKSON')

7.

With SQL, how can you return the number of records in the "Persons" table?

a)

SELECT LEN(*) FROM Persons

b)

SELECT COUNT(*) FROM Persons

c)

SELECT COLUMNS(*) FROM Persons

d)

SELECT NO(*) FROM Persons

8.

Which operator is used to select values within a range?

a)

WITHIN

b)

RANGE

c)

BETWEEN

9.

The NOT NULL constraint enforces a column to not accept NULL values.

a)

TRUE

b)

FALSE

10.

Which of the following is not an aggregate function in SQL?

a)

SUM

b)

FIND

c)

AVG

d)

COUNT

11.

How many Primary keys can be created on a table?

a)

1

b)

2

c)

24

d)

Infinite

12.

Which of the following shows comment in SQL?

a)

& This is a comment.

b)

# This is a comment.

c)

% This is a comment. %

d)

-- This is a comment.

13.

Which SQL keyword is used to make a new table in the database?

a)

INSERT TABLE

b)

NEW TABLE

c)

CREATE TABLE

d)

MAKE TABLE

14.

Which SQL keyword is used to make changes to the structure of a table (e.g. adding new columns)?

a)

CHANGE

b)

DROP

c)

UPDATE

d)

ALTER

15.

Clause to extract details of employees whose FIRST NAME contains "are" anywhere is:

a)

LIKE ('are%')

b)

LIKE ('%are')

c)

LIKE ('_are%')

d)

LIKE ('%are%')

16.

How many tables can be combined using a single inner join?

a)

256

b)

5

c)

1

d)

2

17.

What does "A" stand for in ACID properties of SQL Transactions?

a)

Average

b)

Active

c)

Atomocity

d)

Anonymity

18.

Which join compels the users to create a table alias?

a)

INNER

b)

SELF

c)

OUTER

d)

LEFT

19.

Which of the following wildcard can be used with LIKE clause to match any single character within a specified range:

a)

[ ]

b)

{ }

c)

( )

d)

##

20.

How many clustered index can be there in an SQL table?

a)

1

b)

2

c)

32

d)

Infinite