Student = (SSN, Name, Major) Course = ( CourseNumber, Quarter, CourseTitle, NumberOfUnits, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00.
SQL thank you
Given the following relational
Student = (SSN, Name, Major)
Course = ( CourseNumber, Quarter, CourseTitle, NumberOfUnits, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00.
Enrollment = (SSN,CourseNumber, Quarter, Grade)// Grade is Letter grade or none(Null).
Express the following queries using SQL statements with a minimum number of operations and tables.
- List the SSN and Name of every student who has completed the smallest number of courses(with letter grades). Note that It is possible this smallest number is zero.
- List the SSN of every student who only have B in every course they completed ,i.e. every grade is either Null or B
- List the SSN of every student who only have B and no NULL value in every course they enrolled in.
- List the SSN of every student who did not earn the grade B in any course
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
SQL thank you
Given the following relational database schema:
Student = (SSN, Name, Major)
Course = ( CourseNumber, Quarter, CourseTitle, NumberOfUnits, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00.
Enrollment = (SSN,CourseNumber, Quarter, Grade)// Grade is Letter grade or none(Null).
Express the following queries using SQL statements with a minimum number of operations and tables.
- List the SSN and Name of every student who has completed the smallest number of courses(with letter grades). Note that It is possible this smallest number is zero.
- List the SSN of every student who only have B in every course they completed ,i.e. every grade is either Null or B
- List the SSN of every student who only have B and no NULL value in every course they enrolled in.
- List the SSN of every student who did not earn the grade B in any course