New answers tagged

4 votes
Accepted

In a SQL database, how can I add a unique constraint that depends on a value in a foreign key linked table?

A common trick is to add a unique constraint to physical_locations: create table physical_locations ( physical_location_id char(2) not null -- primary key , name varchar(20) not null , district int ...
user avatar
  • 21.5k

Top 50 recent answers are included