Public
Edited
Dec 26, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chinook.db
select *
from invoices;

Insert cell
Insert cell
chinook.db
select *
from invoices;
Insert cell
Insert cell
chinook.db
SELECT InvoiceDate AS date
from invoices;
Insert cell
Insert cell
chinook.db
SELECT DISTINCT BillingCountry AS Country
FROM invoices;
Insert cell
Insert cell
Insert cell
chinook.db
--your code goes here

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
chinook.db
--your code goes here

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
Insert cell
Insert cell
chinook.db
--your code goes here

Insert cell
Insert cell
Insert cell
chinook.db
--your code goes here

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chinook.db
select
c.FirstName || ' ' || c.LastName as name,
sum(i.Total) as total_spent,
count(i.InvoiceDate) as n_times_shopped
from customers c
join invoices i on c.CustomerId = i.CustomerId
group by name
order by total_spent desc;
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chinook.db
select
t.Composer as artist,
count(ii.InvoiceId) as n_tracks_bought
from tracks t
left join invoice_items ii on t.TrackId = ii.TrackId
where t.composer is not null
group by artist
order by n_tracks_bought asc;
Insert cell
Insert cell
Insert cell
chinook.db
--your code goes here

Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
chinook.db
select
a.Name as Artist,
t.Composer,
t.Name as Track
from artists a
full outer join tracks t
on a.Name = t.Composer;
Insert cell
Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
chinook.db
Type SQL, then Shift-Enter. Ctrl-space for more options.

Insert cell
chinook.db
select c
from
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more