TEC 5323 Advanced Database Technology


Discussion of Week 4

This week's discussion focuses on integrity constraints on database tables.

Discussion Topics:

When we say a database has data integrity, we ensure that all tables in the database contain accurate and consistent data. For example, before we insert new data in "CUSTOMER_ORDER" table (a table containing information which parts a customer has ordered), we make sure the items to be ordered exist in "PARTS" table.

Constraint, also referred to integrity constraint, is an effective way to ensure data integrity in a relational database. There are several types of commonly used integrity constraints, including domain integrity such as "NOT NULL" and "CHECK" constraints, as well as referential integrity. This discussion focuses on referential integrity.

Questions:
  1. What is a primary key?

  2. What is a foreign key?

  3. Why is a foreign key needed?

  4. How to define a foreign key?

Please make sure to answer each of the question.

School of Technology
College of Business & Applied Sciences
Eastern Illinois University