| |
| META TOPICPARENT |
name="CSC210SylS2026" |
SQL Lab 3
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 or your .sql file. Include your name and label each question (using comments).
|
|
< < | Once again, you may assume you know your id number and you may use yourself or another student of your choice (as long as that student has enough data). |
> > | Once again, you may assume you know your id number and you may use yourself or another student of your choice (as long as that student has enough data).
For the questions that specify "a student" and possibly "a given semester", you may pick the student and the semester but use the same ones for all those types of questions. |
| | Questions:
Part A (using only nested queries and NO joins) |
|
< < |
- Display the title of each course one student (of your choice) was enrolled in during one semester (your choice).
- Display the student id numbers of each of the students that shared a class with one specific student (your choice) a specific semester (your choice) (no duplications).
|
> > |
- Display the title of each course a student was enrolled in during a given one semester.
- Display the student id numbers of each of the students that shared a class with a student a given semester (no duplications).
|
| |
- Repeat the previous question but display the students name (no duplications).
|
|
< < |
- Limit the previous response to those students in the same department as your specific student
|
> > |
- Limit the previous response to those students in the same department as a student
|
| |
- Limit the same response to those students that have not shared the department.
|
|
< < |
- Display the names of the students that shared a class with you last semester and have ever shared a major with you.
- Display the names of the students that shared a class with you last semester but have never shared a major with you.
- Display the names of the students that shared a class with you last semester and currently share a major with you.
|
> > |
- Display the names of the students that shared a class a student a given semester and have ever shared a department with that student
- Display the names of the students that shared a class with a student a given semester but have never shared a department with that student.
- Display the names of the students that shared a class with a given student you last semester and currently share a major with you.
|
| |
- Display the names of the students that shared a class with you last semester or have ever shared a major with you.
- Display the all the rooms associated with the classes you took last spring
- Find the names of all the instructors teaching in the Religion and Philosophy department last year.
|