Tags:
view all tags
---++SQL Lab 2 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. BE sure to include your name and label each question (using commnets).<br><br> Unless otherwise specified, you may use your "id number" in the query.<br><br> Questions:<br> <b>Part A (using aggregation and/or functions)</b> 1. Display the courses you have taken (code, number, section, semester) ordered by when they were taken. Assume that there is at least three years of data to be dealt with. (You may assume you know the student id number and if you wish you can pick which student you want as long as it has sufficient data.) 1. Display the number of distinct courses taught fall 2006 using the takes table;. 1. Display the number of instructors teaching the second section of a course in fall of 2006 1. Display the number of instructors teaching the second section of a course each semester that is in the database ordered by when they were taught. 1. Display the day (including the time) of each reservation of a boat. *NOTE: this is using the sailors data, not the enrollment data*. Also be aware what is stored in the data affects what results are seen. 1. Display the max course number and min course number offered by each semester and year 1. Display the number of students take have taken the same course more than twice. 1. For each student, classify them based upon how often they have retaken a course: at most 1 -> standard, 2 -> learned lesson, 3 -> stubborn, > 4 -> struggling 1. List the codes for the courses that have at least one class with an enrollment greater than 300 during the year of 2003 1. Display all students names sorted alphabetically by last name then first name. You may assume that each student only has two names listed. <b>Part B (using only joins)</b> Do not use the word "join" in any sql statement 1. Display the title of each course you were enrolled in last semester 1. Display the all the rooms associated with the classes you took last spring 1. Find the names of all the instructors teaching in the Religion and Philosophy department last year. 1. Display your schedule from last fall 1. Display the name, email, and major of all students majoring last spring in one major of your choice. 1. Display the student id numbers of each of the students that you shared a class with last semester (no duplications) 1. Display the names of each of the students that you shared a class with last semester (no duplications) 1. Find the names of all the instructors who have taught a course with the same course code as anyone who taught ENGL 101 last fall.
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2026-01-14
-
CathyBareiss
Home
Site map
Assessment web
BethelAIResources2026 web
CenterForComputing web
ChatGPT web
Intro2AIatBethel web
Main web
Sandbox web
TWiki web
CenterForComputing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
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