Re: enforcing uniqueness across tables
Posted by: Peter Brawley
Date: July 12, 2015 04:31PM

> equipment can only be in one place at one time

Depends on all the details of the business problem. but a common solution is for stock to be the main table, and define repair and customer tables as child tables eg

stock( sid int primary key, ... )
repair( rid int primary key, sid, date_in, date_out, foreign key(sid) references(stock), ... )
customer( cid int primary key, sid, date_rented, date_returned, foreign key(sid) references(stock), ... )

Options: ReplyQuote


Subject
Written By
Posted
Re: enforcing uniqueness across tables
July 12, 2015 04:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.