Student = (SSN, Name, Major) Course = ( CourseNumber, Quarter, CourseTitle, NumberOfUnits, RoomNumber, DayTime), where DayTime is of the form MW 1:0-2:00.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter3: Creating Tables
Section: Chapter Questions
Problem 13RQ
icon
Related questions
Question

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.

 

  1. 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.
  2. List the SSN of every student who only have B in every course they completed ,i.e. every grade is either Null or B
  3. List the SSN of every student who only have B and no NULL value in every course they enrolled in.
  4. List the SSN of every student who did not earn the grade B in any course
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

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.

 

  1. 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.
  2. List the SSN of every student who only have B in every course they completed ,i.e. every grade is either Null or B
  3. List the SSN of every student who only have B and no NULL value in every course they enrolled in.
  4. List the SSN of every student who did not earn the grade B in any course
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Multiple table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning