Today's Court Bookings
- Each row in the table represents a court booking at a tennis club that has one hard court (Court 1) and one grass court (Court 2)
- A booking is defined by its Court and the period for which the Court is reserved
- Additionally, each booking has a Rate Type associated with it. There are four distinct rate types:
- SAVER, for Court 1 bookings made by members
- STANDARD, for Court 1 bookings made by non-members
- PREMIUM-A, for Court 2 bookings made by members
- PREMIUM-B, for Court 2 bookings made by non-members
The table's superkeys are:
- S1 = {Court, Start Time}
- S2 = {Court, End Time}
- S3 = {Rate Type, Start Time}
- S4 = {Rate Type, End Time}
- S5 = {Court, Start Time, End Time}
- S6 = {Rate Type, Start Time, End Time}
- S7 = {Court, Rate Type, Start Time}
- S8 = {Court, Rate Type, End Time}
- ST = {Court, Rate Type, Start Time, End Time}, the trivial superkey
Note that even though in the above table Start Time and End Time attributes have no duplicate values for each of them, we still have to admit that in some other days two different bookings on court 1 and court 2 could start at the same time or end at the same time. This is the reason why {Start Time} and {End Time} cannot be considered as the table's superkeys.
How is S1 = {Court, Start Time}, a super key?
Say on day 1, a member books court 1 from 11:00 to 12:00, and on day 2, a non member books court 1 from 11:00 to 12:00.
the records in the table would be {1,11:00,12:00, SAVER} and {1,11:00,12:00, STANDARD}
Clearly S1 = {Court, Start Time}, is not superkey. Or am I wrong?