SQL Query Fro University Database
SQL Query Fro University Database
3. Find the department names of all Instructor. i) distinct department ,ii)also with duplicate
5. Find the names of all Instructor in the computer.sci department who have salary greater than 70000.
6.Retrive the names of all Instructor, along with their department names and building name
8. Find the names of Instructor who have thought some course in the computer science department
9. Query for all Instructor in the university who have thought some course, find their names and the
course id of all courses they thought.
10. List the names of all Instructor along with the titles of courses that they teach.
11.Find the names of all instructors whose salary is greater than at least one instructor in the biology
department
12.find the names of all departments whose building name includes the substring ‘watson’
14.finde the names and salary name asceding and salary descending
15.find the names with salary between 90000 and 10000;(using arithmetic and between)
16.Find the instructor names and the courses they thought for all instructors in the biology department
who have thought some course.
17.finde the set of all courses thought either in fall 2009 or in spring 2010 ,or both(keeping duplicate
and removing deuplicate)
18. finde the set of all courses thought in the fall 2009 as well as spring 2010 .(without keeping duplicate
and keeping duplicate)
19. finde the set of all courses thought in the fall 2009 semester but not in the spring 2010 .(without
keeping duplicate and keeping duplicate)
21.Find the number of instructor in each department who teaches a course in the spring 2010
semester.(87)
22.Find only those department where the average salary is more than 42000
23.For each course section offered in 2009, find the average total credits(tot_cred) of all students
enrolled in the section, if the section had at least 2 students
24.Find all the courses thought in the both the fall 2009 and spring 2010 semester.
25. Find all the courses thought in the both the fall 2009 semester but not in spring 2010 semester.
26.selects the names of instructor whose names are neighter “mozarat” nor “einstein”
27.find the total number of distinct students who have taken course sections thought by the instructor
with ID 110011
28.find the names of all instructors whose salary is greater than at least one instructor in the biology
department(using >some)
29.find the names of all instructor that have a salary value greater than that of each instructor in the
biology department(>all using)
31.find the all courses taught in both the fall 2009 and spring 2010 semester.(93)
33.find the all courses that were offered at least twice in 2009
34.find the average instructor salaries of those departments where the average salary is greater than
42000.
35.find the maximum across all departments of the total salary at each department(96).
36.find all departments where the total salary is greater than the average of the total salary at all
departments.(using with and other way)
37.modification ,delete,insertion,update
38. SELECT name,salary,tb FROM instructor,( SELECT avg(salary) as tb from instructor WHERE
dept_name='physics' ) ty WHERE dept_name='physics'