Assignment #4
Joins
1. List all classes (course_no, section_no) taught by instructor Hanks. (9 rows)
SELECT s.course_no, s.section_no
2. Show the student roster (use the format: <last name>, <first name> in a single column) for
each section that Todd Smythe teaches. Identify the section using course number AND section
number. (18 rows)
SELECT s.course_no Course, s.section_no Section,
st.last_name||’, ‘||st.first_name Name
3. List Charles Lowry‘s students (use the format: <last name>, <first name> in a single column)
that live in New Jersey. Sort the result by last name. (14 rows)
SELECT st.last_name||’, ‘||st.first_name Name
4. List the sections taught by instructors who do not live in New Jersey, showing instructor and
state along with course and section numbers. (78 rows)
5. Show instructors (along with their course numbers and section numbers) teaching class
sections with students whose last name begins with ‘M’. (20 rows)
SELECT i.first_name||’ ‘||i.last_name Name, s.course_no, s.section_no
FROM section s, instructor i, enrollment e, student st