SQL Lab 1

This lab uses the enrollment data.

Only turn in the sql statements (not the results of the query). You may test your queries out online. (But remember, just because you get the right data back, that does not mean your query is correct!). Turn in an electronic copy of your .sql file. Include your name and label each question (using comments).

Questions:

  1. Display all the courses you have taken (code, number) ordered by course_id. You can first look up your id number in the student table. (It may be different from what you use at your institution for privacy reasons). If you prefer, you can do it for any one student of your choice instead.
  2. Find the ids of instructor Katz and instructor Califieri. Use that information to display the courses taught by Katz in Fall 2009 or Califieri in Spring 2010.
  3. Find the id of instructor Singh and use it to display the ids of students who were in a Computer Science course taught by Singh in Fall 2009 (CS-101, CS-190, and CS-347). Do not use an IN operator.
  4. Display the ids of students who were in a Computer Science course taught by Singh in Fall 2009 (CS-101, CS-190, and CS-347). Use the IN operator.
  5. Display all courses taught within the Comp. Sci. department that are lower level (not 300 or above).
  6. Display the names and IDs of all professors in one column with just a space separating the two.
  7. Display all the courses (code, number) that have been taught at least once without an assigned location.
  8. Display all the different unique combinations of what days courses have been taught at the university.
  9. (Bonus) Find students who have taken courses taught by both Katz and Califieri.
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2026-01-05 - CathyBareiss
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback