SQL 02 MySQL Design Handout
SQL 02 MySQL Design Handout
SQL 02 MySQL Design Handout
txt
name VARCHAR(255),
PRIMARY KEY(artist_id)
) ENGINE = InnoDB;
title VARCHAR(255),
artist_id INTEGER,
PRIMARY KEY(album_id),
) ENGINE = InnoDB;
name VARCHAR(255),
PRIMARY KEY(genre_id)
) ENGINE = InnoDB;
title VARCHAR(255),
len INTEGER,
rating INTEGER,
count INTEGER,
album_id INTEGER,
genre_id INTEGER,
PRIMARY KEY(track_id),
) ENGINE = InnoDB;
INSERT INTO Album (title, artist_id) VALUES ('Who Made Who', 2);
https://www.wa4e.com/lectures/SQL-02-MySQL-Design-Handout.txt 1/3
17/11/2021 11:33 https://www.wa4e.com/lectures/SQL-02-MySQL-Design-Handout.txt
VALUES ('Who Made Who', 5, 207, 0, 1, 2);
Album.artist_id = Artist.artist_id
Track.genre_id = Genre.genre_id;
DROP TABLE Track; DROP TABLE Album; DROP TABLE Genre; DROP TABLE Artist;
Fresh Database...
name VARCHAR(128),
PRIMARY KEY(account_id)
PRIMARY KEY(course_id)
account_id INTEGER,
course_id INTEGER,
role INTEGER,
https://www.wa4e.com/lectures/SQL-02-MySQL-Design-Handout.txt 2/3
17/11/2021 11:33 https://www.wa4e.com/lectures/SQL-02-MySQL-Design-Handout.txt
ON Member.account_id = Account.account_id
https://www.wa4e.com/lectures/SQL-02-MySQL-Design-Handout.txt 3/3