Entity/Relationship Model → Relational Schema
Depdendent Entities
Fix the foreign key from Track to Album.
 |
create table Artist(
artist_id int not null primary key,
name varchar not null,
...
);
create table Album(
artist_id int not null references Artist,
title varchar not null,
...
primary key(artist_id, title)
);
create table Track(
album_id int not null references Album,
artist_id int not null,
title varchar not null,
track int not null,
title varchar not null,
...
foreign key(artist_id, title) references Album,
primary key(artist_id, title, track)
);
|
|