-- SQL Playground - Edit me!
-- Full PostgreSQL powered by PGlite (PostgreSQL in WebAssembly)
-- Sample database: Chinook (music store)
-- Tables: artists, albums, tracks, genres, customers, invoices
-- Query 1: Show all artists
SELECT * FROM artists LIMIT 10;
-- Query 2: Join albums with artists
SELECT
albums.title AS album,
artists.name AS artist
FROM albums
JOIN artists ON albums.artist_id = artists.artist_id
ORDER BY artists.name
LIMIT 10;
-- Query 3: Count tracks per genre
SELECT
genres.name AS genre,
COUNT(tracks.track_id) AS track_count
FROM genres
LEFT JOIN tracks ON genres.genre_id = tracks.genre_id
GROUP BY genres.name
ORDER BY track_count DESC;