I am slightly confused about one task regarding usage of unique constraint. I've got two tables:
TABLE ROOM
TABLE BUILDING
The requirement is that table ROOM has room code which must be unique only within a particular building (i've got 4 buildings). Not really sure how to do that. Any ideas?
You can have a unique index across multiple columns, so presumably your "room" table would have a unique index on the combination of room number and building id.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Bookmarks