Keys in Databases

In databases, we want to uniquely identify a certain attribute so when we pull information off the database, we only need to see that one attribute to get all the information we need. In this case, the unique attribute of a database is know as the primary key. Primary keys must have no null values or any repeating values.

The best example I like to think of for primary keys are ID numbers.

Foreign Keys are references to primary keys in other tables. Its used as a way to link up 2 or more tables together.

Leave a comment

Design a site like this with WordPress.com
Get started