Data to store in the database
Band
Name |
CD
Title |
Record
Label |
Songs |
Stevie
Wonder |
Talking
Book |
Motown |
You
Are the Sunshine of My Life, Maybe Your Baby, Superstition,… |
Miles
Davis Quintet |
Miles
Sliles |
Columbia |
Orbits,
Circle, … |
Wayne
Shorter |
Speak
No Evil |
Blue
Note |
Witch
Hunt, Fee-Fi-Fo-Fum |
Herbie
Hancock |
Headhunters |
Columbia |
Chameleon,
Watermelon Man, … |
Herbie
Hancock |
Mained
Voyage |
Blue
Note |
Mained
Voyage |
Entities & Attributes
Unique ID
Unique
ID:
1)
unique
2)
not
NULL
3)
never
changes
Normalization (see on another side)
Physical Database Design
Table |
Column |
Datatype |
Notes |
CD |
CD ID |
INT |
primary
key |
|
CD
Title |
TEXT(50) |
|
|
Record
Label Id |
INT |
foreign
key |
CREATE TABLE CD (
CD_ID INT NOT NULL,
RECORD_LABEL_ID INT,
CD_TITLE TEXT,
PRIMARY KEY
(CD_ID)
);
Normalization steps