MENU
Question -

Consider the followingtables FACULTY and COURSES. Write SQL commands for the statements (i) to (v)and give outputs for SQL queries (vi) to (vii)
FACULTY

F_ID

Fname

Lname

Hire_date

Salary

102

Amit

Mishra

12-10-1998

12000

103

Nitin

Vyas

24-12-1994

8000

104

Rakshit

Soni

18-5-2001

14000

105

Rashmi

Malhotra

11-9-2004

11000

106

Sulekha

Srivastava

5-6-2006

10000

COURSES

C_ID

FJD

Cname

C21

102

Grid Computing

40000

C22

106

System Design

16000

C23

104

Computer Security

8000

C24

106

Human Biology

15000

C25

102

Computer Network

20000

C26

105

Visual Basic

6000

(i) To display detailsof those Faculties whose salary is greater than 12000.

 



Answer -

Select * from faculty
where salry > 12000;
(ii) To display the details of courses whose fees is in th range of 15000 to 50000(both values included).
Аnswer:
Select * from Courses
where fees between 15000 and 50000;
(iii)To increase the fees of all courses by 500 of “System Design” Course.
Update courses set fees = fees + 500
where Cname = “System Design”;
(iv)To display details of those courses which are taught by ‘Sulekha’ in descending order of courses.
Аnswer:
Select * from faculty fac, courses cour
where fac.f_id = cour.f_id and fac.fname = ‘Sulekha’ order by cname desc;
(v)Select COUNT (DISTINCT F_ID) from COURSES;
Аnswer:
4
(vi)Select MIN (Salary) from FACULTY, COURSES where COURSES.F_ID = FACULTY.FJD;
Аnswer:
6000

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
×