File size: 1,011 Bytes
9a1f607 | 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 | -- Run one statement at a time with query_spotify.py --sql "...".
SELECT rowid, id, name, popularity, duration_ms
FROM tracks
LIMIT 20;
SELECT track_id, tempo, energy, danceability, acousticness, valence
FROM track_audio_features
WHERE null_response = 0
LIMIT 20;
SELECT t.id, t.name AS track_name, t.popularity,
a.name AS album_name, a.release_date
FROM tracks AS t
LEFT JOIN albums AS a ON a.rowid = t.album_rowid
LIMIT 20;
SELECT t.id, t.name AS track_name, a.name AS artist_name,
a.popularity AS artist_popularity, g.genre
FROM tracks AS t
JOIN track_artists AS ta ON ta.track_rowid = t.rowid
JOIN artists AS a ON a.rowid = ta.artist_rowid
LEFT JOIN artist_genres AS g ON g.artist_rowid = a.rowid
LIMIT 20;
-- Genres belong to artists. A track can have several artists and genres.
-- Feature IDs join to tracks.id, not to the SQLite rowid.
SELECT t.id, t.name, t.popularity, f.tempo, f.energy, f.danceability
FROM tracks AS t
JOIN track_audio_features AS f ON f.track_id = t.id
LIMIT 20;
|