Running Queries

Learn about running SQL queries against Datasets.

Run SQL queries against the Datasets to get total Sales sorted by Year:

%sql select year, sum(sales) totalsales from sales group by year

Run SQL queries against the Datasets to get Sales sorted by Product:

%sql select ProductName, Year, sum(Sales) total from product, sales
where sales.Product = product.Id
group by ProductName, Year
order by total desc