From the course: Database Foundations: Data Structures
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
One-to-one relationships
From the course: Database Foundations: Data Structures
One-to-one relationships
- - [Narrator] One-to-one relationships are not nearly as common as one to many, but they do have their place in certain circumstances. We've already established that the join type is dictated by unique constraints. A one-to-one relationship exists when both columns in the join have a unique constraint on them. This is most commonly seen when joining primary keys in both tables. Here's an example of when this might occur. In this human resources database, we've got one table to store common information about some employees like their name and the department that they work in. This information isn't very sensitive and it's made available to everyone in the company. But the human resources department has a second table that adds some information about each of these employees such as their salary or their government issued tax ID number. Since both tables use the employee ID as the primary key, which is by definition…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
One-to-many relationships2m 13s
-
(Locked)
One-to-one relationships1m 27s
-
(Locked)
Many-to-many relationships2m 14s
-
(Locked)
Self-referencing relationships1m 56s
-
(Locked)
Cascade updates and deletes4m 35s
-
(Locked)
Challenge: Link tables with keys1m 8s
-
(Locked)
Solution: Link tables with keys6m 23s
-
(Locked)
-
-
-