Physical and Relational Data Model
IT Notes → Database @ December 22, 2020
- A candidate key is a combination of attributes that can be uniquely used to identify a database record without any extraneous data. Each table may have one or more candidate keys. One of these candidate keys is selected as the table primary key.
- Any candidate key which is not a primary key is called an alternate key.
Primary key is a unique identifier for a table.
- Should be unique.
- Should not hold null (undefined).
- Should not change value for its lifetime.
If it has more than one attribute it is called composite key.
Foreign key is a primary key in a different table. Diagrammatically, a foreign key is depicted as a line with an arrow at one end.
Fields are the columns in databases. They can also be a piece of specific information from a record.
A table is a row and column arrangement of data.
Referential Integrity says that
- We may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table.
- Cascading update has to be implemented meaning when a record in the linked table changes, all foreign keys in the Employees table must be modified using a cascading update.
- Cascading delete has to be implemented meaning when a record in the linked table changes, all records in the linking table must be deleted using a cascading delete.
Subscribe
Login
0 Comments
Oldest