CSC 170
Homework 7

Assigned Apr 23, due May 4

The task we're trying to accomplish

Every semester, the Adelphi registrar has to figure out which courses will be in which classrooms at which times. This is a tricky problem, requiring some sophisticated database operations. We'll do a simplified version of it.

Develop an Access database to help with the problem of assigning Adelphi courses to classrooms and time slots. (When I originally assigned this, I added "and instructors", but I think that just makes it more complicated without making it more interesting, so we can skip the instructors.)

Certain information is known before the process starts: the type and capacity of each classroom, the maximum number of students in each course, the type of classroom each course should be in (for example, CSC 170 should be in a computer lab, and MTH 140 should be in a lecture room), etc. You'll probably need several tables -- say, a table of classrooms, a table of courses, etc. -- to keep track of this information. Fill in these tables with a reasonable variety of courses, classrooms, etc. so you can test whether your queries work. For example, make sure there are classrooms of different types and different sizes, so you can test whether your queries to check those things work correctly.

The task next requires somebody to choose a classroom and a time slot for each course. You may view this as filling in a separate table, or as filling in additional fields in the table of courses (as far as I know, either way should work).

Simplifying assumptions

To save your sanity and mine, please make the following simplifying assumptions:

Constraints and queries

In order for the solution to make sense, certain things have to be true:

Access provides some capabilities for enforcing rules like these. For example, it's fairly easy to have your database insist that the only legal "classroom types" are CLC, LEC, and SCL; if somebody types in something else in that field, they get an error message immediately. Likewise, it's fairly easy to have your database reject assigning a course to a nonexistent classroom or a nonexistent time slot; see "enforcing referential integrity" in the textbook. Doing these checks automatically is extra credit.

But for most of these rules, probably the best thing to do is define a query that finds violations of the rule. So you would want to define the following queries:

In addition, in the process of making assignments, it'll be helpful to have queries like

What to turn in

Turn in (by attaching it to an e-mail) an Access database file containing whatever tables you need, and the definitions of the queries I've asked for above. The tables should be filled in with a good selection of classrooms, courses, etc. -- let's say, at least ten classrooms, thirty courses, and five time slots.

Also fill in a "bad" assignment of courses to classrooms and time slots. By a "bad" assignment I mean one that violates the rules: there should be at least one example of a course that doesn't have a classroom or a time slot assigned, at least one example of a course assigned to the wrong type of classroom, at least one example of a course assigned to the right type of classroom but too small, at least one example of two courses assigned to the same classroom at the same time. This "bad" assignment is necessary so we can tell whether your queries work correctly to detect violations of the rules.


Last modified:
Stephen Bloch / sbloch@adelphi.edu