Originally Posted by Fou-Lu
So with my example above, I can successfully insert the data: 1 | BBB | 2013-02-09 for example since to composite key of 1,BBB are not yet in use.
Lack of sleep >>
Okay, so a foreign key sounds like the solution then..
There are no user accounts on my website. I included 3 columns in the disc_id table (gamename, gamecode and region) for records sake. I only need to use the gamecode column.
The sole purpose is as you stated, to protect the DB from visitors submitting illogical data to the database. It is a game compatibility database, and there is no reason for a user to have complete control over the ID of the game they are submitting. Hence the compiled list of 9,250 valid disc IDs (and growing).
I'm only fresh into SQL, and I'm unsure how to apply a FK constraint between my main table (opl_comp) and the table used for confirming disc IDs (disc_id).