Posts Tagged ‘constraints’

MySQL Foreign Keys

Posted: 23rd July 2009 by Tim in MySQL
Tags: , , , ,

Foreign keys are a good way to ensure consistency between tables, by ensuring that the value in one table column exists in another table. For example, you might have a person table which contains person_id, first_name and surname. You may then have another table, person_ages, which contains person_id and date_of_birth. You would add a foreign […]