Skip to content
Advertisement

Tag: foreign-keys

foreign key column doesn’t want to take an insert says column can’t be null

i’m trying to populate a foreign key column ‘boss_id’ from a junction table called ‘clown_boss’ boss_id is new self-referencing foreign key that is meant to hold the ‘id’ value of the clown’s boss. i already have a populated junction table that contains ‘id’ from clown_info table and newly created ‘boss_id’ that also references ‘id’ from clown. this is what clown_info

Can Foreign Key on a table be three different tables as primary keys (each table primary key data is different)?

I have a reminder table (ParentId) – Foreign key to ProductId from Product and also OrderId from Order table. Is it possible? When I try to insert the data for the Reminder table belongs to OrderId, I’m getting Foreign-Key constraint error. Answer You can do this with a bit of work, using foreign key relationships and computed columns. This does

Advertisement