The ORM Foundation

Get the facts!

pdf Reservations - a sample model (pdf)

Downloads: 920 File Size: 210.5kB
Posted By: Ken Evans Views: 1,987
Date Added: Sun, Mar 16 2014

 I developed this sample model in response to a question by Niels Hoogeveen in this forum thread.

Niels asked about the use of exclusion constraints in PostgreSQL to prevent overlapping time constraints. However, when I looked at his sample, it seemed to me that the easiest way to solve the "no overlaps in reservations" problem was to use the quaternary fact type "Person reserves Classroom for Date at HourSlot" and to put a uniqueness constraint across Person Classroom and Date to say that for any Classroom and Date only one hour slot may be booked.

This PDF shows the object-role model, the relational schema, some verbalization and DDL for PostgreSQL 

File updated 17 March


No comments exist for this file.
© 2008-2020 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service