Академический Документы
Профессиональный Документы
Культура Документы
Theory
Databases have the function of enabling data integrity in various ways. One of the ways that this is done
is by ensuring that related tables have constraints such as primary keys that are unique, and not null,
foreign keys that will not get orphaned in the event that a parent row is removed from the main table,
or if a change is made to a primary key in the parent table. An orphaned relation, or table, is one that
does not have any relationship with a parent table record. This usually introduces inconsistencies in a
database if it is allowed to perpetuate.
Objective
The objective of this exercise is to demonstrate referential integrity as a way of encapsulating overall
data integrity in table structures.
Tools/Applications
MySQL is preferred to demonstrate the DDL commands. MS Access maybe used if MySQL is not
accessible.
Lab Activity:
Reflection
1. How would you design your relationship to ensure that an update cascades? Is it possible to
cascade an update with the present setup?
2. What would happen if the relationship between COURSE and SEMESTER was released (or
removed), and some data inserted into SEMESTER (CMP106, CMP107) and then the
relationship re-established?
3. Why would it be useful to enforce a deletion cascade?