From the course: Database Foundations: Data Structures
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Purpose of a primary key
From the course: Database Foundations: Data Structures
Purpose of a primary key
- [Instructor] We've touched on the topic of primary key fields a couple of times now, and they're vitally important when creating a properly normalized database design. They're the glue that holds all of your data together when it's spread out across related tables. Each cell in a data table must be uniquely identifiable. In a spreadsheet application, this is easy. The spreadsheet has built in column letters and row numbers so that I can refer specifically to whatever value is stored in cell A1, or make a reference to the value that's in cell D8. Relational databases don't use these same row and column identifiers, so we need a slightly different approach. In a relational database table, each column has a unique name, so that part is already taken care of, but the rows of data can appear in any order. They can get filtered out of the results using SELECT queries or sorted into different sequences with an ORDER BY clause.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.