DROP TABLE IF EXISTS cd;
DROP TABLE IF EXISTS artist;

CREATE TABLE artist (
   artist_id int(5) NOT NULL,
   artist_name varchar(50),
   PRIMARY KEY (artist_id)
);

CREATE TABLE cd (
   cd_id int(5) NOT NULL,
   cd_name varchar(50),
   artist_id int(5) NOT NULL,
   PRIMARY KEY (cd_id),
   FOREIGN KEY (artist_id) REFERENCES artist(artist_id)
);

INSERT INTO artist VALUES (1,  'Leo Kottke');
INSERT INTO artist VALUES (2,  'Wizz Jones');
INSERT INTO artist VALUES (3,  'Altan');
INSERT INTO artist VALUES (4,  'John Fahey');


INSERT INTO cd VALUES (1, 'Mudlark', 1);
INSERT INTO cd VALUES (2, 'My Feet Are Smiling', 1);
INSERT INTO cd VALUES (3, 'Lucky The Man', 2);
INSERT INTO cd VALUES (4, 'The Blue Idol', 3);
INSERT INTO cd VALUES (5, 'Return of the Repressed', 4);

SELECT cd_name, artist_name FROM cd NATURAL JOIN artist;
