Tables and Keys Flashcards
(9 cards)
Columns
Define a single attribute
Row
Individual entry representing the principle subject of the table
Primary Key
Attribute that uniquely identifies a specific row/entry. Typically the first column. Must be unique
Surrogate (Primary Key)
Key that has no mapping to anything in the real world. (sequential employee ID number)
Natural (Primary Key)
Key that has some purpose outside of the database. (social security number)
Foreign Key
Stores a Primary Key helps define relationships between multiple DB tables. This also Includes new relationships to the Primary Key within the same table (get better definition)
Foreign Key Relationships
Relationships between tables can be made more robust by abstracting a meaningful attribute from a table’s Primary Key and using that as another table’s Foreign Key link back to the original table
Composite Key
A Key represented by two or more columns. The individual columns might repeat, but the composite will be unique
Foreign Primary Composite Key
These most meaningful keys can create the logic for tables and represent additional data