Consider the following relation. Instructor (ID , name, dept – name, salary) Department (dept – name , building ,budget) Classroom (building , roomno , capacity ) Teaches (ID , course – id , sec – id , semesters ) Course (course – id , title , dept – name , credit ) Student (ID , name dept – name ,fot – ored ) Takes (ID , course – id , sec – id, semester , year, grade) Write down queries expressed in SQL. 1) Find the name of all instructors who got the highest salary in their department. 2) Find the names of all the students whose total credits are greater than 100. 3) Find the course id and grades of all courses taken by any student. 4) Find all departments that have at least one instructor, and list – the name of the departments along with the number of instructor
Consider the following relation. Instructor (ID , name, dept – name, salary) Department (dept – name , building ,budget) Classroom (building , roomno , capacity ) Teaches (ID , course – id , sec – id , semesters ) Course (course – id , title , dept – name , credit ) Student (ID , name dept – name ,fot – ored ) Takes (ID , course – id , sec – id, semester , year, grade) Write down queries expressed in SQL.
1) Find the name of all instructors who got the highest salary in their department.
2) Find the names of all the students whose total credits are greater than 100.
3) Find the course id and grades of all courses taken by any student.
4) Find all departments that have at least one instructor, and list – the name of the departments along with the number of instructor
Trending now
This is a popular solution!
Step by step
Solved in 2 steps