Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

DBS Lab 3 Quiz

Total questions: 8

Worksheet time: 6mins

Name
Class
Date
1.

The default ordering followed in the ORDER BY clause is?

a)

Ascending

b)

Descending

2.

What will be the order followed for salary, name and dept_name respectively in the following case:

select * from instructor  order by dept_name, salary, name DESC;

a)

Desc, desc, desc

b)

Asc, desc, desc

c)

Asc, desc, Asc

d)

Asc, Asc, desc

3.

The “AS” keyword is optional while specifying an alias for a field name in a select statement

a)

True

b)

False

4.

what is the correct order of evaluation of the following where clause:

Where not a or b and c

a)

(not a) or (b and c)

b)

Not (a or (b and c))

c)

((not a) or b) and c

d)

All are the same for SQL

5.

Say you have a relation r1(course_name, course_id, room_alloted). The room_alloted may have null values (if no room is allotted to a course). You are interested in all those classes that DONOT occur in a particular set of rooms (say A).

Is the following SQL query correct for that?

Select * from r1 where room_alloted not in A;

a)

YES

b)

NO

6.

Which of the following is a correct way to find all those students whose names begin with a vowel?

a)

Select * from student where NAME in (“a%”,”e%”,”i%”,”o%”,”u%”);

b)

Select * from student where NAME like (“a%”,”e%”,”i%”,”o%”,”u%”);

c)

select * from student where NAME like "a%" or NAME like "e%" or NAME like "i%" or NAME like "o%" or NAME like "U%";

d)

All

7.

Are the following joins equivalent?

Q1: Select * from T1 left join T2 using (ID);

Q2: Select * from T1 left join T2 on T1.ID=T2.ID;

a)

YES

b)

NO

8.

What will be the output on applying "SELECT AVG(DISCO) FROM T1" if T1 is as given:

a)

(30+40+45+30+40+20)/6

b)

(30+40+45+30+40+0+0+0+0+0+20)/11

c)

(30+40+45+30+40+0+0+0+0+0+null+20)/12