The image shows the dependency graph for tables used in a car-racing example
in which the team
table has a foreign-key column,
lead_driver
, which is linked to the driver
table's
primary-key column driver_id
. Other than the addition of this link, it
is the same as the graph for the car-racing example.
There are four boxes, with labels driver_race_map
,
race
, driver
, and team
— the four
table names.
At the bottom is the driver_race_map
box. Two arrows leave from this
box, one with arrowhead on the race
box, which is above and to the left
of the driver_race_map
box, and one with arrowhead on the
driver
box, which is above and to the right of the
driver_race_map
box.
The left arrow, ending at the race
box, has two labels: (1)
race_id
(PK), at the arrowhead end, and (2)
race_id
(FK), at the arrow-origin end. The right arrow, ending at
the driver
box, has two labels: (1) driver_id
(PK), at
the arrowhead end, and (2) driver_id
(FK), at the arrow-origin end.
At the top of the diagram, above the driver
box, is the
team
box. There's an arrow from the team
box to
the driver
box. It has two labels: (1) driver_id
(PK),
at the arrowhead end, and (2) lead_driver
(FK), at the arrow-origin
end. There's an arrow from the driver
box to the team
box. It has two labels: (1) team_id
(PK), at the arrowhead end, and (2)
team_id
(FK), at the arrow-origin end.
At the lower-right corner of the diagram is a box with title Legend:. The box has these two rows of text: PK: Primary Key and FK: Foreign Key.