Skip to content

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.

  1. Should be unique.
  2. Should not hold null (undefined).
  3. 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

  1. We may not add a record to the table that contains the foreign key unless there is a corresponding record in the linked table.
  2. 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.
  3. 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.
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x