Join Adam Wilbert for an in-depth discussion in this video Understanding the role of key fields, part of Database Fundamentals: Storage.
- [Voiceover] We talked a lot about…key fields in the last chapter,…and they are vitally important when creating…properly normalized tables.…Each record in the data table must be uniquely identifiable.…This means that there needs to be some piece…of information that I can give the system,…and have it return one very specific record…or a row from the data table.…These primary key values allow the database…to properly join related tables together again.…The primary key is an attribute or a set of attributes…used to uniquely identify each row.…A table can only have one primary key constraint,…it must be a unique value within the table…and it cannot be left blank or null when saving a record.…
So the entire point of a primary key on a data table…is to ensure the presence of a unique identifier…for each and every record.…Many times, this'll be some sort of serial number…or other tracking code that's only purpose…is to provide that unique attribute on a row of data.…Other times the database itself will create…a primary key on the fly using an auto-incrementing…
Note: This course will also prepare certification candidates for the "Understanding data storage" domain of the Microsoft Technology Associate (MTA) Exam 98-364, Database Administration Fundamentals. Find out more at https://www.microsoft.com/learning/en-us/exam-98-364.aspx.
- Reducing redundancy with normalization
- Fixing partial dependencies
- Creating primary keys
- Linking tables with foreign keys
- Creating clustered and nonclustered indexes