-- M1B practice-problems extended dataset (additive to the canonical seed).
-- Generated by tools/gen_sql_practice_dataset.py. Paste after the canonical
-- Users/Songs/Listens are loaded. Canonical rows are NOT repeated here.

CREATE TABLE IF NOT EXISTS Recommendations (
    user_id INTEGER NOT NULL REFERENCES Users(user_id),
    song_id INTEGER NOT NULL REFERENCES Songs(song_id),
    recommendation_id SERIAL PRIMARY KEY
);

-- added songs (11-18)
INSERT INTO Songs (song_id, title, artist, genre) VALUES
  (11, 'Anti-Hero', 'Taylor Swift', 'Pop'),
  (12, 'Cruel Summer', 'Taylor Swift', 'Pop'),
  (13, 'Perfect', 'Ed Sheeran', 'Rock'),
  (14, 'Castle on the Hill', 'Ed Sheeran', 'Rock'),
  (15, 'Let It Be', 'Beatles', 'Classic'),
  (16, 'Come Together', 'Beatles', 'Classic'),
  (17, 'Hello', 'Adele', 'Pop'),
  (18, 'Rolling in the Deep', 'Adele', 'Pop');

-- added listens (users 1-3 only; Pluto stays zero-listen)
INSERT INTO Listens (listen_id, user_id, song_id, rating) VALUES
  (10, 2, 1, 4.0),
  (11, 3, 3, 4.4),
  (12, 1, 3, 3.7),
  (13, 2, 3, 4.8),
  (14, 3, 4, 4.1),
  (15, 1, 4, 4.0),
  (16, 2, 5, 4.4),
  (17, 3, 9, 3.7),
  (18, 1, 9, 4.8),
  (19, 2, 11, 4.1),
  (20, 3, 11, 4.0),
  (21, 1, 11, 4.4),
  (22, 2, 11, 3.7),
  (23, 3, 11, 4.8),
  (24, 1, 12, 4.1),
  (25, 2, 13, 4.0),
  (26, 3, 13, 4.4),
  (27, 1, 13, 3.7),
  (28, 2, 13, 4.8),
  (29, 3, 14, 4.1),
  (30, 1, 14, 4.0),
  (31, 2, 15, 4.4),
  (32, 3, 15, 3.7),
  (33, 1, 15, 4.8),
  (34, 2, 16, 4.1),
  (35, 3, 16, 4.0),
  (36, 1, 17, 4.4),
  (37, 2, 17, 3.7),
  (38, 3, 17, 4.8),
  (39, 1, 17, 4.1),
  (40, 2, 18, 4.0);

-- recommendations for Mickey (user 1)
INSERT INTO Recommendations (user_id, song_id) VALUES
  (1, 3),
  (1, 9),
  (1, 11),
  (1, 17);
