wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DML

Total questions: 25

Worksheet time: 19mins

Name
Class
Date
1.

SQL is

a)

Structured Query Language

b)

Simple Query Language

c)

Structured Question Language

d)

Structure Quality Language

2.

DML

(a)  

3.

To remove a record from a table which SQL statement would you use?

a)

Remove

b)

Cancel

c)

Delete

d)

Eradicate

4.

Which statement is used to extract data from a database?

a)

Extract

b)

Get

c)

Open

d)

Select

5.

Which statement allows us to add a record to a table?

a)

Add To

b)

Update To

c)

Add Into

d)

Insert Into

6.

Which word is missing from the following SQL statement?


Select * table_name

a)

With

b)

Where

c)

From

d)

And

7.

Which SQL statement would add a record to the database?

a)

INSERT INTO Designer VALUES ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456')

b)

INSERT VALUES ('SMI01', 'M Smith', 'mail@msmith.com', 01224123456') INTO Designer

c)

INSERT ('SMI01', 'M Smith', 'mail@msmith.com', '01224123456') INTO Designer

d)

INSERT Designer INTO VALUES (''SMI01', 'M Smith', 'mail@msmith.com', '01224123456')

8.

It is a DML command that is used to display record.

a)

DISPLAY

b)

STRUCTURE

c)

WHERE

d)

SELECT

9.

______________ constraint prevents NULL values

a)

UNIQUE

b)

NOT NULL

c)

NULL

d)

FOREIGN KEY

10.

A primary key can be NULL in the table? TRUE or FALSE

a)

TRUE

b)

FALSE

11.

A clause in the SELECT command that specifies the condition the records must satisfy.

a)

Table_name

b)

WHERE

c)

LIKE

d)

Database name

12.

This symbol is an SQL wildcard that can substitute for one or more characters when searching for data in a database.

a)

$

b)

%

c)

=

d)

*

13.

You are required to update the phone number for only the DesignerID "SMI01" in the "Designer" table. Which of these would successfully do that?

a)

UPDATE Designer SET PhoneNo = '01224123456'

b)

UPDATE Designer (PhoneNo) VALUES ('01224123456')

c)

UPDATE Designer SET PhoneNo = '01224123456' WHERE DesignerID = 'SMI01'

d)

UPDATE PhoneNo = '01224123456' FROM Designer WHERE DesignerID = 'SMI01'

14.

If you don’t specify ASC or DESC after a SQL ORDER BY clause, the following is used by default

a)

ASC

b)

DESC

c)

There is no default value

d)

None of the mentioned

15.

Find the name of those cities with temperature and condition whose condition is either sunny or cloudy but temperature must be greater than 70.

a)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ OR temperature > 70

b)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ OR temperature > 70

c)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ OR condition = ‘cloudy’ AND temperature > 70

d)

SELECT city, temperature, condition FROM weather WHERE condition = ‘sunny’ AND condition = ‘cloudy’ AND temperature > 70

16.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)

SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)

SELECT * FROM Persons WHERE FirstName=’%a%’

17.

Here which of the following displays the unique values of the column?

SELECT ________ dept_name

FROM instructor;

a)

from

b)

like

c)

unique

d)

distinct

18.

The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predicate.

a)

Where, from

b)

From, select

c)

Select, from

d)

From, where

19.

Which of the following statements contains an error?

a)

Select * from emp where empid = 10003;

b)

Select empid from emp where empid = 10006;

c)

Select empid from emp;

d)

Select empid where empid = 1009 and lastname = ‘GELLER’;

20.

In the given query which of the keyword has to be inserted?

INSERT INTO employee _____ (1002,'Joey',2000);

a)

table

b)

values

c)

from

d)

relation

21.

SELECT * FROM sales WHERE amount > 200.

a)

the query will display all the sales records with amounts starting from 200 and above

b)

the query will display all the sales records with amounts less than 200

c)

the query will display all the sales records with amounts greater than 200

d)

the query will output sales records with the amount equal to 200.

22.

In a LIKE clause, you can ask for any 6 letter value by writing

a)

LIKE ______ (that's six underscore characters)

b)

LIKE ...... (that's six dots)

c)

LIKE .{6}

d)

LIKE ??????

23.

The SQL keyword BETWEEN is used:

a)

For ranges.

b)

To limit the columns displayed.

c)

As a wildcard.

d)

None of the above

24.

SELECT * FROM cars WHERE Doors > 3

would return how many records?

a)

1

b)

2

c)

3

d)

4

25.

SELECT * FROM Students WHERE Gender="Female" AND Class=2.2

would return how many records?

a)

1

b)

2

c)

3

d)

4