1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| DROP TABLE if EXISTS Listens; DROP TABLE if EXISTS Friendship; CREATE TABLE If NOT EXISTS Listens (user_id INT, song_id INT, DAY DATE); CREATE TABLE If NOT EXISTS Friendship (user1_id INT, user2_id INT); TRUNCATE TABLE Listens; INSERT INTO Listens (user_id, song_id, DAY) VALUES ('1', '10', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('1', '11', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('1', '12', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('2', '10', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('2', '11', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('2', '12', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('3', '10', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('3', '11', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('3', '12', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('4', '10', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('4', '11', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('4', '13', '2021-03-15'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('5', '10', '2021-03-16'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('5', '11', '2021-03-16'); INSERT INTO Listens (user_id, song_id, DAY) VALUES ('5', '12', '2021-03-16'); TRUNCATE TABLE Friendship; INSERT INTO Friendship (user1_id, user2_id) VALUES ('1', '2');
|