The Student Registry Database Ian Van Houdt and Muna alfahad
Queries
Exercise.. List the elective courses o Use “Except”
Exercise.. List the departments that do not have any courses yet o Try to list the department name and name this attribute “department” + college name and name it “college” o Try to use “join” and “IN predicate”
Exercise.. Show majors (name) and the courses (code + name) each major offers. Sort by major name
Exercise.. List all courses and their prerequisites if any o Use “LEFT Join” o Sorted by course id
Exercise.. List maximum, minimum and average salaries of the instructors in each department (name) o Sorted by the department name
Exercise.. Show students who have more than one major o Student id, first_name, middle_name, last_name, and the number of majors as “no. of majors”
Exercise.. Show CS and MATH courses in Fall 2014 o Course code, building number, room number, day and time o CS department id is 13 & Math department id is 8
Exercise.. Americans instructors whose salaries are greater than the maximum salary of German instructors o Instructor id, first_name, middle_name, last_name, job_title and salary o Use subquery
Exercise.. Show the elective courses that offered by each major o Course id, course code, course name, and major name o Try to use “IN or NOT IN predicate”
Exercise.. Show the Canadian student with the best GPA o Student id, first name, last name o Try to use Subquery in Where clause, and the ALL predicate
Exercise.. List all Computer Science exchange students o Student id, first name, last name, nationality
Exercise.. Find CS student with the highest GPA o Id, first and last name o Try using a subquery in the Where clause
Exercise.. Find terms and years that CS 202 has been offered
Exercise.. List the nationality and the number of students from that country that are CS majors Order by most to least
Exercise.. List the id, first and last name of the highest performing CS student (GPA)