I am trying to create a table that holds info about a user; with the usual columns for firstName, lastName, etc... no problem creating the table or it's columns, but how can I "restrict" the values of my State column in the 'users' table so that it only accepts values from the 'states' table?
You could create a trigger on the table or a rule?|||The term which applies to your situation is called "referential integrity". To enforce referential integrity in your situation, you could use aFOREIGN KEY constraint in your table which limits the possibilities in the State column to only those values in the 'states' table.sqlThursday, March 22, 2012
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment