Query Sol Sessional 1
Query Sol Sessional 1
EMPLOYEE (Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, Super_ssn, Dno)
1. Retrieve the name and address of all employees who work for the ‘Research’ department.
2. Find the names of employees who work on all the projects controlled by department number 25.
3. Make a list of project numbers for projects that involve an employee whose last name is ‘Smith’, either as a
worker or as a manager of the department that controls the project.
1. Retrieve the name and address of all employees who work for the ‘Research’
department.
2. Find the names of employees who work on all the projects controlled by
department number 15.
3. Make a list of project numbers for projects that involve an employee whose last
name is ‘Smith’, either as a worker or as a manager of the department that
controls the project.
2.b) Consider the following relations:
Student(snum: integer, sname: string, major: string, level: string, age: integer)
The meaning of these relations are for example, Enrolled has one record per student-cl ass pair such that
the student is enrolled in the class.
Write the following queries in SQL. No duplicates should be printed in any of the answers.
1. Find the names of faculty members who teach in every room in which some class is taught.
2. Find the names of faculty members for whom the combined enrollment of the courses that they teach is
more than 5.
For each level, print the level and the average age of students for that level.