New answers tagged

1

Just make the Tour optional? The below code is for SQL Server, but you should be able to port this to other flavors of SQL. Essentially, the TourID column can be nullable, indicating the Gig is not part of a Tour. CREATE TABLE dbo.Bands ( BandID INT NOT NULL PRIMARY KEY CLUSTERED , BandName VARCHAR(100) NOT NULL ); CREATE TABLE dbo.Tours ...


1

I just made something similar for a colleague. Essentially I made a hidden table that contained one row for each (user,role) pair with suitable constraints. The user table was then a view of the hidden table with all the roles assembled into an array. I then made it possible to insert into the view by adding an appropriate rule. Here is how: trailer=# ...



Top 50 recent answers are included