Oracle SQL Tutorial 5 Database Integrity Database Design Primer 2
This is the second video in the 5 database design videos in my oracle sql tutorial series. This video discusses database integrity. Database integrity is broken up into 3 sections: entity integrity, referential integrity, and domain integrity. Entity integrity focuses on the primary key. A primary key should be unique, NOT NULL, and never changing. It should refer to only one individual entity. Referential integrity focuses on protecting the relationships between entities of different tables. When creating relationships between tables, you will associate a column with another column in a different table. Individual entities inside of this table should have relationships with individual entities in the other table. For example, a comment table might have a userid column. Each individual comment (each row), should have a userid that points to a userid in the user table. We protect referential integrity with what are known as foreign key constraints.
|
|