Question: 3. (10 points) Consider the following relations and their attributes. Student(snum, sname, major, level, age) Class(cname, room) Enrolled(snum, cname) TimeSlot(tsid, day_of_week, start, end) Meets At(cname,

 3. (10 points) Consider the following relations and their attributes. Student(snum,

3. (10 points) Consider the following relations and their attributes. Student(snum, sname, major, level, age) Class(cname, room) Enrolled(snum, cname) TimeSlot(tsid, day_of_week, start, end) Meets At(cname, tsid) The meaning of these relations is straightforward. For example, relation Enrolled connects students with classes. Relation Meets At connects classes with timeslots. A given class usually connects with more than one timeslot, e.g. CSC 370 connects with timeslots: e.g. (13, 'Tuesday', '10:30', '11:30'), (34, 'Wednesday', '10:30', '11:30'), (45, 'Friday', '10:30', '11:30'). Write SQL statements for the following questions. 1. (3 pts) Print the level and the average age of C. Sci. students for that level, for each level. 2. (3 pts) For each student (snum), find the number of classes he or she is enrolled in. (Students with zero classes should be reported too.) 3. (4 pts) Find the snum's of students enrolled in classes with overlapping time slots. Observe that the start and end attributes of the timeslot tuples can be properly compared as strings (e.g. '09:30'

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!