Public
Edited
Dec 16, 2022
Insert cell
Insert cell
Insert cell
database = FileAttachment("chinook.db").sqlite()
Insert cell
Insert cell
Insert cell
Insert cell
database
SELECT Name, COUNT(albums.ArtistId) as albums_total FROM albums
LEFT JOIN artists on artists.ArtistId=albums.ArtistId
GROUP BY albums.ArtistId
ORDER BY albums_total DESC
LIMIT 1
Insert cell
Insert cell
database
SELECT Name, COUNT(albums.ArtistId) as albums_total FROM albums
LEFT JOIN artists on artists.ArtistId=albums.ArtistId
GROUP BY albums.ArtistId
HAVING COUNT(albums.ArtistId) > 5
Insert cell
Insert cell
database
-- SELECT genres.GenreId, genres.Name, tracks.Milliseconds FROM genres JOIN tracks ON genres.GenreId = tracks.GenreId

SELECT genres.Name, SUM(Milliseconds)/60000 as Total_minutes FROM tracks
LEFT JOIN genres on genres.GenreId=tracks.GenreId
group by tracks.GenreId
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more