{
    "ok" : true,
    "about" : "Read-only SQL over the Magnatune catalog (SQLite). Send one SELECT as ?q=, as the POST body, or as JSON {\"sql\": \"...\"}.",
    "limits" : {
        "max_rows" : 1000,
        "max_seconds" : 3,
        "queries_per_minute" : 20,
        "query_seconds_per_minute" : 10
    },
    "schema_markdown" : "## SQL queries: find music any way you like\n\n`GET https://magnatune.com/api/sql?q=SELECT...` (or `POST` the SQL as the body, as `sql=` form data, or as JSON `{\"sql\": \"...\"}`) runs one **read-only** SQLite `SELECT` on the whole catalog and returns `{columns, rows, row_count, truncated, ms}`. No key needed. Limits: one statement, at most 1000 rows (add `LIMIT`/`OFFSET` to page), 3 seconds per query, 20 queries and 10 seconds of query time per minute per IP. `GET https://magnatune.com/api/sql` with no query returns this schema as JSON.\n\nThe same database is downloadable: <https://magnatune.com/info/sqlite_normalized.db> (SQLite file), <https://magnatune.com/info/sqlite_normalized.db.gz> (gzipped), <https://magnatune.com/info/sqlite_normalized.sql.gz> (gzipped SQL dump: `gunzip` it and run it into an empty SQLite database). It is rebuilt with every new release; <https://magnatune.com/info/changed.txt> changes when it does.\n\n### Ready-made views (start here)\n\n- **`album_details`**: one row per album with everything you usually filter on: `album_id, sku, album, artist_id, artist, artist_page, city, state, country, release_date` (YYYY-MM-DD), `popularity` (higher = more listened to), `pro` (collecting society short name), `pro_description`, `genres` (comma-separated), `web_url`, `api_url`.\n- **`song_vocals`**: `song_id, vocals`, and **`album_vocals`**: `album_id, vocals`. `vocals` is `n` (instrumental: never had vocals), `y` (has singing) or `r` (vocals removed: the \"(vocals removed)\" albums, whose sku is the original's sku + `nv`, same track numbers), or NULL (not checked yet). For instrumental music use `coalesce(v.vocals,'') <> 'y'`.\n- **`album_ai`**: `album_id, moods, uses, energy, instrumentation, sounds_like, summary`: each album described by an AI model for people choosing music for videos. `moods` and `uses` are comma-separated words from fixed lists (`GET https://magnatune.com/api/vocabulary`); match one with `(', ' || moods || ',') LIKE '%, uplifting,%'`. `energy` is 1 (very calm) to 5 (very intense).\n- The same data is in the `albums` columns `moods, uses, energy, instrumentation, sounds_like, ai_summary` and the `songs` column `bpm` (in catalogs exported since 2026-10-20).\n- **`song_bpm`**: `song_id, bpm`: approximate tempo from automatic detection, folded into 80-160 (fair for rock, electronic and dance; unreliable for ambient and classical).\n- **`song_audio`**: `song_id, tempo, tempo_conf, beats_conf, musical_key, key_strength, danceability, loudness_db, energy, audio_moods, audio_instruments`: each song measured from its audio (Essentia). `tempo` is only meaningful when `beats_conf >= 1.5` (a steady beat; ambient, rubato and free-time pieces score lower); `musical_key` like `D minor`; `energy` 1-5 (fifths of the catalog); `audio_moods` (MTG-Jamendo moods/themes such as film, relaxing, energetic, corporate, epic) and `audio_instruments` (piano, cello, electricguitar, synthesizer, drums, voice...) are comma-separated. Also in the `songs` columns of catalogs exported since 2026-10-21.\n- **`album_subgenres`**: `album_id, subgenre_id, subgenre`. Use this rather than joining `subgenres_albums` yourself (its ids are off by one in current exports; the view corrects it).\n\n### How the tables join\n\n```text\n  pro ◄──── albums.pro              (each album: one collecting society)\n             │\n  artists ◄─ albums.artist_id       (artist 1 : N albums)\n             │ album_id\n             ├──► songs.album_id                        (album 1 : N songs, ordered by track_no)\n             │       └─ song_id ──► playlist_songs ──► playlists   (N : M, ordered by sort_order)\n             ├──► genres_albums      ──► genres          (N : M)\n             ├──► subgenres_albums   ──► subgenres       (N : M; ids off by one: use the album_subgenres view)\n             ├──► collections_albums ──► collections     (N : M)\n             └──► recommendations    ──► albums          (album -> recommended album, rank 1 = best)\n```\n\n| Foreign key (child) | Points to (parent) | Relationship |\n|---|---|---|\n| `albums.artist_id` | `artists.artists_id` | each album has one artist; an artist has many albums |\n| `albums.pro` | `pro.pro_id` | the album's collecting society (0 = Unknown, 25 = NONE) |\n| `songs.album_id` | `albums.album_id` | an album's tracks; `songs.track_no` gives their order |\n| `genres_albums.album_id`, `genres_albums.genre_id` | `albums.album_id`, `genres.genre_id` | many-to-many: an album has 1+ genres |\n| `subgenres_albums.album_id`, `subgenres_albums.subgenre_id` | `albums.album_id`, `subgenres.subgenre_id` **- 1** | many-to-many, but the link ids are one LOW in current exports: join `subgenres.subgenre_id = subgenres_albums.subgenre_id + 1`, or simply use the `album_subgenres` view |\n| `collections_albums.album_id`, `collections_albums.collection_id` | `albums.album_id`, `collections.collections_id` | many-to-many: moods, instruments, uses, composers |\n| `playlist_songs.playlist_id`, `playlist_songs.song_id` | `playlists.playlist_id`, `songs.song_id` | many-to-many, ordered by `playlist_songs.sort_order` |\n| `recommendations.album_id`, `recommendations.recommended_album_id` | `albums.album_id` (both) | album-to-album suggestions, `rank` 1 = best match |\n\nWatch the key names: the artist key is `artists.artists_id` (plural) but `albums.artist_id`; the collection key is `collections.collections_id` but `collections_albums.collection_id`. SQLite doesn't declare these foreign keys in the file (`PRAGMA foreign_key_list` is empty); the table above is the authority. Indexes exist on every `album_id`, `artist_id`, `genre_id`, `subgenre_id` and `collection_id` join column.\n\n**Ids are permanent**: `artists_id`, `album_id` and `song_id` stay the same from one release to the next and are never reused, so they are safe to store. `song_id` = `album_id` * 100 + `track_no` (albums have at most 99 tracks), so `song_id / 100` is the album and `song_id % 100` the track. Ids from exports before October 2026 were renumbered on every release and don't match these.\n\n### Tables and columns\n\n| Table (rows) | Column | Type | Meaning (example) |\n|---|---|---|---|\n| `artists` (723) | `artists_id` | integer, key | permanent: never changes or gets reused |\n| | `name` | text, unique | display name (`Paolo Pavan`) |\n| | `page` | text | URL slug: https://magnatune.com/artists/{page}/ (`paolo_pavan`) |\n| | `homepage` | text | same as `page` (legacy) |\n| | `description` | text | one-line style summary (`Urban funky jazz piano...`) |\n| | `bio` | text | full biography |\n| | `photo` | text | site path of the photo (`/artists/img/paolo_pavan.jpg`) |\n| | `city`, `state`, `country` | text | where they're from; `state` only for the USA (`Rome`, empty, `Italy`) |\n| `albums` (1,927) | `album_id` | integer, key | permanent: one per sku, never changes or gets reused |\n| | `artist_id` | integer | -> `artists.artists_id` |\n| | `name` | text, unique | album title (`French Kiss`) |\n| | `sku` | text, unique | the album's id everywhere in this API (`1kub-frenchkiss`) |\n| | `description` | text | album notes |\n| | `upc` | text | barcode |\n| | `release_date` | integer | Unix timestamp; `date(release_date, 'unixepoch')` gives YYYY-MM-DD |\n| | `popularity` | integer | higher = more listened to |\n| | `pro` | integer | -> `pro.pro_id` |\n| | `itunes_buy_url` | text | legacy, usually empty |\n| `pro` (51) | `pro_id`, `name`, `description` | integer, text, text | collecting society: `NONE` (25) = in none, `Unknown` (0) = not recorded, `ASCAP`, `BMI`, `PRS`, `SACEM`, `GEMA`... (`description` adds the country) |\n| `songs` (23,771) | `song_id` | integer, unique | `album_id` * 100 + `track_no`, so permanent too (`56406` = track 6 of album 564) |\n| | `album_id` | integer | -> `albums.album_id` |\n| | `name` | text | song title |\n| | `track_no` | integer | 1, 2, ...; the audio: `GET /api/albums/{sku}/tracks/{track_no}/file` |\n| | `duration` | integer | seconds |\n| | `mp3` | text | the file name on the server (`01-I'm Monster-1kub.mp3`) |\n| `genres` (10) | `genre_id`, `name` | integer, text | Alt Rock, Ambient, Classical, Electro Rock, Electronica, Hard Rock, Hip Hop, Jazz, New Age, World |\n| `subgenres` (80) | `subgenre_id`, `name` | integer, text | finer styles: Baroque, Blues, Chamber Music... |\n| `collections` (472) | `collections_id`, `name` | integer, text | moods, instruments, uses (`Background Mix`) and one per classical composer |\n| `genres_albums` (2,478), `subgenres_albums` (5,221), `collections_albums` (3,723) | | integer pairs | the many-to-many links above |\n| `playlists` (24) | `playlist_id`, `sort_order`, `owner_id`, `name` | | Magnatune-curated playlists (`80s Rock`) |\n| `playlist_songs` (5,867) | `playlist_id`, `sort_order`, `song_id` | integers | the songs of each playlist, in order |\n| `recommendations` (35,492) | `album_id`, `recommended_album_id`, `rank` | integers | \"if you like this, try...\" |\n\n### Join recipes\n\n- An album with its artist and collecting society:\n  `SELECT al.sku, al.name AS album, ar.name AS artist, ar.country, p.name AS pro FROM albums al JOIN artists ar ON ar.artists_id = al.artist_id JOIN pro p ON p.pro_id = al.pro WHERE al.sku = '1kub-frenchkiss'`\n- An album's tracks, in order:\n  `SELECT s.track_no, s.name, s.duration FROM songs s JOIN albums al ON al.album_id = s.album_id WHERE al.sku = '1kub-frenchkiss' ORDER BY s.track_no`\n- Albums in a genre:\n  `SELECT al.sku, al.name FROM albums al JOIN genres_albums ga ON ga.album_id = al.album_id JOIN genres g ON g.genre_id = ga.genre_id WHERE g.name = 'Jazz'`\n- Albums in a subgenre (the raw ids are one low, hence + 1):\n  `SELECT al.sku, al.name FROM albums al JOIN subgenres_albums sa ON sa.album_id = al.album_id JOIN subgenres sg ON sg.subgenre_id = sa.subgenre_id + 1 WHERE sg.name = 'Baroque'`\n- Albums in a collection:\n  `SELECT al.sku, al.name FROM albums al JOIN collections_albums ca ON ca.album_id = al.album_id JOIN collections c ON c.collections_id = ca.collection_id WHERE c.name = 'Background Mix'`\n- A playlist's songs, in order, with their albums:\n  `SELECT ps.sort_order, s.name AS song, al.sku, s.track_no FROM playlists pl JOIN playlist_songs ps ON ps.playlist_id = pl.playlist_id JOIN songs s ON s.song_id = ps.song_id JOIN albums al ON al.album_id = s.album_id WHERE pl.name = '80s Rock' ORDER BY ps.sort_order`\n- Albums recommended for an album:\n  `SELECT r.rank, rec.sku, rec.name FROM recommendations r JOIN albums src ON src.album_id = r.album_id JOIN albums rec ON rec.album_id = r.recommended_album_id WHERE src.sku = '1kub-frenchkiss' ORDER BY r.rank`\n\nText matching: `LIKE` is case-insensitive for ASCII; genres in `album_details.genres` are comma-separated, so match with `genres LIKE '%Jazz%'`. Every album row is a released, visible album.\n\n### Example queries\n\n- Jazz artists from outside the USA whose albums are in no collecting society (11 artists: Argentina, Brazil, Czech Republic, England, Germany, Italy, Japan, Russia, Serbia):\n  `SELECT DISTINCT artist, city, country, album FROM album_details WHERE genres LIKE '%Jazz%' AND country <> 'USA' AND pro = 'NONE' ORDER BY country, artist`\n- French jazz artists, with the collecting society each album is in (none are society-free, so this shows how to relax a filter):\n  `SELECT DISTINCT artist, city, album, pro_description FROM album_details WHERE country = 'France' AND genres LIKE '%Jazz%'`\n- Short ambient tracks (2-3 minutes) from albums in no collecting society, most popular first:\n  `SELECT d.artist, d.album, s.track_no, s.name AS song, s.duration, d.api_url || '/tracks/' || s.track_no AS track_api FROM songs s JOIN album_details d ON d.album_id = s.album_id WHERE d.genres LIKE '%Ambient%' AND d.pro = 'NONE' AND s.duration BETWEEN 120 AND 180 ORDER BY d.popularity DESC LIMIT 50`\n- Albums in a subgenre (use the album_subgenres view, not subgenres_albums):\n  `SELECT d.artist, d.album, d.release_date FROM album_subgenres x JOIN album_details d ON d.album_id = x.album_id WHERE x.subgenre = 'Baroque' ORDER BY d.release_date DESC`\n- Instrumental songs (no singing) of 2-4 minutes in the Cinematic collection:\n  `SELECT d.artist, d.album, s.track_no, s.name AS song, s.duration FROM songs s JOIN song_vocals v ON v.song_id = s.song_id JOIN album_details d ON d.album_id = s.album_id JOIN collections_albums ca ON ca.album_id = s.album_id JOIN collections c ON c.collections_id = ca.collection_id WHERE c.name = 'Cinematic' AND coalesce(v.vocals, '') <> 'y' AND s.duration BETWEEN 120 AND 240 ORDER BY d.popularity DESC LIMIT 50`\n- Calm, uplifting instrumental songs for a corporate video (moods and uses from album_ai), 2-4 minutes:\n  `SELECT d.artist, d.album, s.track_no, s.name AS song, s.duration, ai.energy, ai.summary FROM songs s JOIN album_ai ai ON ai.album_id = s.album_id JOIN song_vocals v ON v.song_id = s.song_id JOIN album_details d ON d.album_id = s.album_id WHERE (', ' || ai.uses || ',') LIKE '%, corporate,%' AND (', ' || ai.moods || ',') LIKE '%, uplifting,%' AND v.vocals IN ('n','r') AND s.duration BETWEEN 120 AND 240 ORDER BY d.popularity DESC LIMIT 50`\n- Fast electronic tracks around 128 BPM with high energy, for a workout video:\n  `SELECT d.artist, d.album, s.track_no, s.name AS song, b.bpm FROM songs s JOIN song_bpm b ON b.song_id = s.song_id JOIN album_ai ai ON ai.album_id = s.album_id JOIN album_details d ON d.album_id = s.album_id WHERE d.genres LIKE '%Electronica%' AND b.bpm BETWEEN 124 AND 132 AND ai.energy >= 4 ORDER BY d.popularity DESC LIMIT 50`\n- Steady-beat songs around 90 BPM in a minor key with piano, under 3 minutes:\n  `SELECT d.artist, d.album, s.track_no, s.name AS song, x.tempo, x.musical_key, x.audio_instruments FROM songs s JOIN song_audio x ON x.song_id = s.song_id JOIN album_details d ON d.album_id = s.album_id WHERE x.beats_conf >= 1.5 AND x.tempo BETWEEN 85 AND 95 AND x.musical_key LIKE '% minor' AND (', ' || x.audio_instruments || ',') LIKE '%, piano,%' AND s.duration < 180 ORDER BY d.popularity DESC LIMIT 50`\n- Albums per country:\n  `SELECT country, count(*) AS albums FROM album_details GROUP BY country ORDER BY albums DESC`\n- Albums in a collection (moods, instruments, uses, composers):\n  `SELECT d.artist, d.album FROM collections c JOIN collections_albums ca ON ca.collection_id = c.collections_id JOIN album_details d ON d.album_id = ca.album_id WHERE c.name = 'Background Mix'`\n\nTo use what you find: each `sku` works with `/api/albums/{sku}` (tracks, covers, credit lines); clean audio needs a membership (see \"Paying from an agent\").",
    "examples" : [{
        "what" : "Jazz artists from outside the USA whose albums are in no collecting society (11 artists: Argentina, Brazil, Czech Republic, England, Germany, Italy, Japan, Russia, Serbia)",
        "sql" : "SELECT DISTINCT artist, city, country, album FROM album_details WHERE genres LIKE '%Jazz%' AND country <> 'USA' AND pro = 'NONE' ORDER BY country, artist",
        "try" : "https://magnatune.com/api/sql?q=SELECT+DISTINCT+artist%2c+city%2c+country%2c+album+FROM+album_details+WHERE+genres+LIKE+'%25Jazz%25'+AND+country+%3c%3e+'USA'+AND+pro+%3d+'NONE'+ORDER+BY+country%2c+artist"
    },{
        "what" : "French jazz artists, with the collecting society each album is in (none are society-free, so this shows how to relax a filter)",
        "sql" : "SELECT DISTINCT artist, city, album, pro_description FROM album_details WHERE country = 'France' AND genres LIKE '%Jazz%'",
        "try" : "https://magnatune.com/api/sql?q=SELECT+DISTINCT+artist%2c+city%2c+album%2c+pro_description+FROM+album_details+WHERE+country+%3d+'France'+AND+genres+LIKE+'%25Jazz%25'"
    },{
        "what" : "Short ambient tracks (2-3 minutes) from albums in no collecting society, most popular first",
        "sql" : "SELECT d.artist, d.album, s.track_no, s.name AS song, s.duration, d.api_url || '/tracks/' || s.track_no AS track_api FROM songs s JOIN album_details d ON d.album_id = s.album_id WHERE d.genres LIKE '%Ambient%' AND d.pro = 'NONE' AND s.duration BETWEEN 120 AND 180 ORDER BY d.popularity DESC LIMIT 50",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album%2c+s.track_no%2c+s.name+AS+song%2c+s.duration%2c+d.api_url+%7c%7c+'/tracks/'+%7c%7c+s.track_no+AS+track_api+FROM+songs+s+JOIN+album_details+d+ON+d.album_id+%3d+s.album_id+WHERE+d.genres+LIKE+'%25Ambient%25'+AND+d.pro+%3d+'NONE'+AND+s.duration+BETWEEN+120+AND+180+ORDER+BY+d.popularity+DESC+LIMIT+50"
    },{
        "what" : "Albums in a subgenre (use the album_subgenres view, not subgenres_albums)",
        "sql" : "SELECT d.artist, d.album, d.release_date FROM album_subgenres x JOIN album_details d ON d.album_id = x.album_id WHERE x.subgenre = 'Baroque' ORDER BY d.release_date DESC",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album%2c+d.release_date+FROM+album_subgenres+x+JOIN+album_details+d+ON+d.album_id+%3d+x.album_id+WHERE+x.subgenre+%3d+'Baroque'+ORDER+BY+d.release_date+DESC"
    },{
        "what" : "Instrumental songs (no singing) of 2-4 minutes in the Cinematic collection",
        "sql" : "SELECT d.artist, d.album, s.track_no, s.name AS song, s.duration FROM songs s JOIN song_vocals v ON v.song_id = s.song_id JOIN album_details d ON d.album_id = s.album_id JOIN collections_albums ca ON ca.album_id = s.album_id JOIN collections c ON c.collections_id = ca.collection_id WHERE c.name = 'Cinematic' AND coalesce(v.vocals, '') <> 'y' AND s.duration BETWEEN 120 AND 240 ORDER BY d.popularity DESC LIMIT 50",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album%2c+s.track_no%2c+s.name+AS+song%2c+s.duration+FROM+songs+s+JOIN+song_vocals+v+ON+v.song_id+%3d+s.song_id+JOIN+album_details+d+ON+d.album_id+%3d+s.album_id+JOIN+collections_albums+ca+ON+ca.album_id+%3d+s.album_id+JOIN+collections+c+ON+c.collections_id+%3d+ca.collection_id+WHERE+c.name+%3d+'Cinematic'+AND+coalesce(v.vocals%2c+'')+%3c%3e+'y'+AND+s.duration+BETWEEN+120+AND+240+ORDER+BY+d.popularity+DESC+LIMIT+50"
    },{
        "what" : "Calm, uplifting instrumental songs for a corporate video (moods and uses from album_ai), 2-4 minutes",
        "sql" : "SELECT d.artist, d.album, s.track_no, s.name AS song, s.duration, ai.energy, ai.summary FROM songs s JOIN album_ai ai ON ai.album_id = s.album_id JOIN song_vocals v ON v.song_id = s.song_id JOIN album_details d ON d.album_id = s.album_id WHERE (', ' || ai.uses || ',') LIKE '%, corporate,%' AND (', ' || ai.moods || ',') LIKE '%, uplifting,%' AND v.vocals IN ('n','r') AND s.duration BETWEEN 120 AND 240 ORDER BY d.popularity DESC LIMIT 50",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album%2c+s.track_no%2c+s.name+AS+song%2c+s.duration%2c+ai.energy%2c+ai.summary+FROM+songs+s+JOIN+album_ai+ai+ON+ai.album_id+%3d+s.album_id+JOIN+song_vocals+v+ON+v.song_id+%3d+s.song_id+JOIN+album_details+d+ON+d.album_id+%3d+s.album_id+WHERE+('%2c+'+%7c%7c+ai.uses+%7c%7c+'%2c')+LIKE+'%25%2c+corporate%2c%25'+AND+('%2c+'+%7c%7c+ai.moods+%7c%7c+'%2c')+LIKE+'%25%2c+uplifting%2c%25'+AND+v.vocals+IN+('n'%2c'r')+AND+s.duration+BETWEEN+120+AND+240+ORDER+BY+d.popularity+DESC+LIMIT+50"
    },{
        "what" : "Fast electronic tracks around 128 BPM with high energy, for a workout video",
        "sql" : "SELECT d.artist, d.album, s.track_no, s.name AS song, b.bpm FROM songs s JOIN song_bpm b ON b.song_id = s.song_id JOIN album_ai ai ON ai.album_id = s.album_id JOIN album_details d ON d.album_id = s.album_id WHERE d.genres LIKE '%Electronica%' AND b.bpm BETWEEN 124 AND 132 AND ai.energy >= 4 ORDER BY d.popularity DESC LIMIT 50",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album%2c+s.track_no%2c+s.name+AS+song%2c+b.bpm+FROM+songs+s+JOIN+song_bpm+b+ON+b.song_id+%3d+s.song_id+JOIN+album_ai+ai+ON+ai.album_id+%3d+s.album_id+JOIN+album_details+d+ON+d.album_id+%3d+s.album_id+WHERE+d.genres+LIKE+'%25Electronica%25'+AND+b.bpm+BETWEEN+124+AND+132+AND+ai.energy+%3e%3d+4+ORDER+BY+d.popularity+DESC+LIMIT+50"
    },{
        "what" : "Steady-beat songs around 90 BPM in a minor key with piano, under 3 minutes",
        "sql" : "SELECT d.artist, d.album, s.track_no, s.name AS song, x.tempo, x.musical_key, x.audio_instruments FROM songs s JOIN song_audio x ON x.song_id = s.song_id JOIN album_details d ON d.album_id = s.album_id WHERE x.beats_conf >= 1.5 AND x.tempo BETWEEN 85 AND 95 AND x.musical_key LIKE '% minor' AND (', ' || x.audio_instruments || ',') LIKE '%, piano,%' AND s.duration < 180 ORDER BY d.popularity DESC LIMIT 50",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album%2c+s.track_no%2c+s.name+AS+song%2c+x.tempo%2c+x.musical_key%2c+x.audio_instruments+FROM+songs+s+JOIN+song_audio+x+ON+x.song_id+%3d+s.song_id+JOIN+album_details+d+ON+d.album_id+%3d+s.album_id+WHERE+x.beats_conf+%3e%3d+1.5+AND+x.tempo+BETWEEN+85+AND+95+AND+x.musical_key+LIKE+'%25+minor'+AND+('%2c+'+%7c%7c+x.audio_instruments+%7c%7c+'%2c')+LIKE+'%25%2c+piano%2c%25'+AND+s.duration+%3c+180+ORDER+BY+d.popularity+DESC+LIMIT+50"
    },{
        "what" : "Albums per country",
        "sql" : "SELECT country, count(*) AS albums FROM album_details GROUP BY country ORDER BY albums DESC",
        "try" : "https://magnatune.com/api/sql?q=SELECT+country%2c+count(*)+AS+albums+FROM+album_details+GROUP+BY+country+ORDER+BY+albums+DESC"
    },{
        "what" : "Albums in a collection (moods, instruments, uses, composers)",
        "sql" : "SELECT d.artist, d.album FROM collections c JOIN collections_albums ca ON ca.collection_id = c.collections_id JOIN album_details d ON d.album_id = ca.album_id WHERE c.name = 'Background Mix'",
        "try" : "https://magnatune.com/api/sql?q=SELECT+d.artist%2c+d.album+FROM+collections+c+JOIN+collections_albums+ca+ON+ca.collection_id+%3d+c.collections_id+JOIN+album_details+d+ON+d.album_id+%3d+ca.album_id+WHERE+c.name+%3d+'Background+Mix'"
    }],
    "downloads" : {
        "sqlite" : "https://magnatune.com/info/sqlite_normalized.db",
        "sqlite_gz" : "https://magnatune.com/info/sqlite_normalized.db.gz",
        "sql_dump_gz" : "https://magnatune.com/info/sqlite_normalized.sql.gz"
    }
}