CSC455 Ch. 5 Lab 3 SQL Multi-table Queries

Using your University database, write queries for the following.  Copy and paste both your SQL query and the results into a document.  Submit into BB or print to hand in.

 

1.   Find the classes (classNumber) in which the student named Ann Chin is enrolled.  Use Cartesian product.

 

2.   Find the names of students earning an A grade.  Use join/on.

 

3.   Find the schedule and room for the student named Jane Rivera.  Use natural join.

 

4.   Find classNumbers and schedules of courses that meet in the same room. Include the room number that they share.  Omit from the results cases where the course is the same or if the pair has already been included in opposite order.  (i.e. Include A,B but not B,A or A,A). Use Cartesian product. There should be 5 columns in the result.

 

5.   Find the studentID and grade for any student earning the same grade in different classes. Use Cartesian product.  (To test, assign the same grade to S1010 in the Enroll table where the grade is NULL.)

 

The following instance may help: