1.
Name
Annie
Bob
Callie
Derek

Which of these query will display the the table employee given above ?

a) Select employee from name
b) Select name
c) Select name from employee
d) Select employee


2. Select ________ dept_name
from instructor;
Here which of the following displays the unique values of the column ?
a) All
b) From
c) Distinct
d) Name


3. 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


4. Select ID, name, dept name, salary * 1.1
where instructor;
The query given below will not give an error. Which one of the following has to be replaced to get the desired output?
a) Salary*1.1
b) ID
c) Where
d) Instructor


5. The ________ clause is used to list the attributes desired in the result of a query.
a) Where
b) Select
c) From
d) Distinct


6. Select name, course_id
from instructor, teaches
where instructor_ID= teaches_ID;
This Query can be replaced by which one of the following ?
a) Select name,course_id from teaches,instructor where instructor_id=course_id;
b) Select name, course_id from instructor natural join teaches;
c) Select name ,course_id from instructor;
d) Select course_id from instructor join teaches;


7. Select * from employee where salary>10000 and dept_id=101;
Which of the following fields are displayed as output?
a) Salary, dept_id
b) Employee
c) Salary
d) All the field of employee relation


8.
Employee_id     Name     Salary
1001     Annie     6000
1009     Ross     4500
1018     Zeith     7000

This is Employee table.
Select * from employee where employee_id>1009;
Which of the following employee_id will be displayed?
a) 1009, 1001, 1018
b) 1009, 1018
c) 1001
d) 1018


9. 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’;


10. Insert into employee _____ (1002,Joey,2000);
In the given query which of the keyword has to be inserted ?
a) Table
b) Values
c) Relation
d) Field


Answers ------->

1. Answer:c      Explanation:The field to be displayed is included in select and the table is included in the from clause.
2. Answer:c        Explanation:Distinct keyword selects only the entries that are unique.
3. Answer:a        Explanation:Where selects the rows on a particular condition.From gives the relation which involves the operation.
4. Answer:c     Explanation:Where selects the rows on a particular condition.From gives the relation which involves the operation. Since Instructor is a relation it has to have from clause.
5. Answer:b
6. Answer:b        Explanation:Join clause joins two tables by matching the common column .
7. Answer:d        Explanation:Here * is used to select all the fields of the relation .
8. Answer:d        Explanation:Greater than symbol does not include the given value unlike >=.
9. Answer:d        Explanation:This query do not have from clause which specifies the relation from which the values has to be selected .
10.Answer:b        Explanation:Value keyword has to be used to insert the values into the table.

0 Comments:

Post a Comment