Quick Ref.
Functions
date
number
string
Data Types
date
number
string

Musik-Datenbank

In dieser Datenbank gibt es zwei Tabellen. Die Tabelle album enthält Daten von 200 Musik-CDs. (Quelle: Amazon)

album
asin title artist price release label rank
B00000255F Born to Run Bruce Springsteen 13.98 1975-08-25 Sony 521
B000002UAU Sgt. Pepper's Lonely Hearts Club Band The Beatles 13.49 1967-06-01 Capitol 218
...

Die Stücke jedes Albums werden in einer separaten Tabelle track gespeichert. Diese Tabelle wird über die Spalte track.album mit der Spalte album.asin der album-Tabelle verbunden.

track
album dsk posn song
B00000255F 1 1 Thunder Road
B00000255F 1 2 Tenth Avenue Freeze-Out
B00000255F 1 3 Night
B00000255F 1 4 Backstreets
B00000255F 1 5 Born to Run
...
B000002UAU 1 1 Sgt. Pepper's Lonely Hearts Club Band
B000002UAU 1 2 With a Little Help from My Friends
B000002UAU 1 3 Lucy in the Sky With Diamonds
B000002UAU 1 4 Getting Better
B000002UAU 1 5 She's Leaving Home
...

Der JOIN über beide Tabellen enthält je einen Datensatz für jedes Stück. Er enthält Spalten aus beiden Tabellen. Die Spalten der album-Tabelle tauchen wiederholt auf.

album JOIN track ON (asin=album)
ASIN TITLE ARTIST PRICE RELEASE LABEL RANK ALBUM DSK POSN SONG
B000002UAU Sgt. Pepper's Lonely Hearts Club Band The Beatles 13.49 01-JUN-67 Capitol 218 B000002UAU 1 1 Sgt. Pepper's Lonely Hearts Club Band
B000002UAU Sgt. Pepper's Lonely Hearts Club Band The Beatles 13.49 01-JUN-67 Capitol 218 B000002UAU 1 2 With a Little Help from My Friends
B000002UAU Sgt. Pepper's Lonely Hearts Club Band The Beatles 13.49 01-JUN-67 Capitol 218 B000002UAU 1 3 Lucy in the Sky With Diamonds
B000002UAU Sgt. Pepper's Lonely Hearts Club Band The Beatles 13.49 01-JUN-67 Capitol 218 B000002UAU 1 4 Getting Better
B000002UAU Sgt. Pepper's Lonely Hearts Club Band The Beatles 13.49 01-JUN-67 Capitol 218 B000002UAU 1 5 Fixing a Hole
B00000255F Born to Run Bruce Springsteen 13.98 25-AUG-75 Sony 521 B00000255F 1 1 Thunder Road
B00000255F Born to Run Bruce Springsteen 13.98 25-AUG-75 Sony 521 B00000255F 1 2 Tenth Avenue Freeze-Out
B00000255F Born to Run Bruce Springsteen 13.98 25-AUG-75 Sony 521 B00000255F 1 3 Night
B00000255F Born to Run Bruce Springsteen 13.98 25-AUG-75 Sony 521 B00000255F 1 4 Backstreets
B00000255F Born to Run Bruce Springsteen 13.98 25-AUG-75 Sony 521 B00000255F 1 5 Born to Run
...