SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE Artists ( id int auto_increment primary key, name varchar(255) ); CREATE TABLE Tracks ( id int auto_increment primary key, artist_id int, title varchar(255), path varchar(255), INDEX(artist_id), FOREIGN KEY (artist_id) REFERENCES Artists(id) ); CREATE TABLE Playlist ( id int auto_increment primary key, track_id int, scheduled tinyint, INDEX(track_id), FOREIGN KEY (track_id) REFERENCES Tracks(id) ); INSERT INTO Artists (name) VALUES ('Nazareth'); INSERT INTO Tracks (artist_id, title, path) VALUES (1, 'Broken Down Angel', 'Broken_Down_Angel.mp3'); INSERT INTO Playlist VALUES (1, 1, 0);
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear