Saved Bookmarks
| 1. |
Consider the following tables FACULTY and COURSES. Write SQL commands for the statements (i) to (v) and give outputs for SQL queries (vi) to (vii)FACULTYF_IDFnameLnameHire_dateSalary102AmitMishra12-10-199812000103NitinVyas24-12-19948000104RakshitSoni18-5-200114000105RashmiMalhotra11-9-200411000106SulekhaSrivastava5-6-200610000COURSESC_IDF_IDCnameFeesC21102Grid Computing40000C22106System Design16000C23104Computer Security8000C24106Human Biology15000C25102Computer Network20000C26105Visual Basic6000(i) To display details of those Faculties whose salary is greater than 12000.(ii) To display the details of courses whose fees is in the range of 15000 to 50000 (both values included).(iii) To increase the fees of all courses by 500 of “System Design” Course.(iv) To display details of those courses which are taught by ‘Sulekha’ in descending order of courses.(v) Select COUNT(DISTINCT F_ID) from COURSES;(vi) Select MIN(Salary) from FACULTY,COURSES where COURSES.F_ID = FACULTY.F_ID; |
|
Answer» (i) Select * from faculty where salary > 12000 (ii) Select * from Courses where fees between 15000 and 50000 (iii) Update courses set fees = fees + 500 where Cname = “System Design” (iv) Select * from faculty fac,courses cour where fac.f_id = cour.f_id and fac.fname = 'Sulekha' order by cname desc (iv) 4 (iv) 6000 |
|