Changes between Version 8 and Version 9 of AdvancedDatabaseDevelopment


Ignore:
Timestamp:
08/05/26 11:13:39 (22 hours ago)
Author:
231136
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedDatabaseDevelopment

    v8 v9  
    380380{{{
    381381CREATE materialized VIEW top_songs_by_listens AS
    382 SELECT s.id, me.title, me.genre, u.full_name, u.username, me.cover, s.album_id
     382SELECT s.id, me.title, me.genre, u.full_name, u.username, s.album_id
    383383FROM songs s
    384384JOIN listens l ON l.song_id = s.id
     
    386386JOIN users u ON u.user_id = me.released_by
    387387GROUP BY
    388     s.id, me.title, me.genre, u.full_name, u.username, me.cover, s.album_id
     388    s.id, me.title, me.genre, u.full_name, u.username, s.album_id
    389389ORDER BY count(*) DESC
    390390LIMIT 10;
     
    398398    me.title AS song_title,
    399399    me.genre AS song_genre,
    400     me.cover AS song_cover,
    401400    s.link AS song_link,
    402401    alb_me.id AS album_id,
     
    420419    p.playlist_id AS playlist_id,
    421420    p.name AS playlist_name,
    422     p.cover AS playlist_cover,
    423421    p.created_by AS creator_id,
    424422    COUNT(ps.song_id) AS song_count
    425423FROM project.playlists p
    426424LEFT JOIN project.playlist_songs ps ON p.playlist_id = ps.playlist_id
    427 GROUP BY p.playlist_id, p.name, p.cover, p.created_by;
     425GROUP BY p.playlist_id, p.name, p.created_by;
    428426}}}
    429427
     
    500498);
    501499
    502 CREATE TABLE PLAYLISTS (
    503     playlist_id BIGINT PRIMARY KEY,
    504     cover media_url, -- <--- custom domain
    505     name TEXT NOT NULL,
    506     created_by BIGINT REFERENCES LISTENERS(user_id) ON DELETE CASCADE NOT NULL
    507 );
    508 
    509500}}}
    510501