---++SQL Lab 3 This lab uses the enrollment data.<br /><br /> 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).<br /><br /> 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).<br><br> 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:<br /> <b>Part A (using only nested queries and NO joins)</b> 1 Display the title of each course a student was enrolled in during a given one semester. 1 Display the student id numbers of each of the students that shared a class with a student a given semester (no duplications). 1 Repeat the previous question but display the students name (no duplications). 1 Limit the previous response to those students in the same department as a student 1 Limit the same response to those students that have not shared the department. 1 Limit the same response to those students that have shared the class or the department. 1 Display the distinct names of the instructors in the same department as Arinb (but not Arinb) 1 Display the courses that do not have a prerequisite. You must use exists. 1 Display the all the building, room combinations associated with the classes a student took a given semester. 1 Find the names of all the instructors who did not teach a given semester. (You choose the semester) 1 Find the names of the students have had a class in all rooms that have been used in Main. You may use joins in the subqueries, but you must use subqueries and you cannot use count. *Part B (Primary work cannot be done using a join or a nested query)* 1 Display the ids of all people (students and instructors) associated directly with the computer science department 1 Display the ids of all students who took a course during the fall and spring of 2009 1 Display the ids of all students who took a course during the fall of 2009 but not the spring. *Part C (use any method you wish)* 1 The names of the instructors that have taught the largest number of different students in a given semester 1 The names of the students who have taken the largest load in a during the fall of 2006. Include the number of hours the student took that semester. 1 The department with the highest average salary of its faculty
This topic: CenterForComputing
>
WebHome
>
Syllabi
>
SyllabiSpring2026
>
CSC210SylS2026
>
CSC210S2026Lab3
Topic revision: r4 - 2026-01-21 - CathyBareiss
Copyright © 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