Skip to content

Queries to the Chinook Database utilizing SQLite and DB Browser for query execution and database migration. The Chinook Dataset mimics a music service account database, so there are tables for Artists, Albums, Tracks, Playlists, Customers, Employees, and Invoices

Notifications You must be signed in to change notification settings

DreRandaci/chinook-dre-randaci

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Chinook Database Queries

These are exercises querying the Chinook Database utilizing SQLite and DB Browser. The Chinook Dataset mimics a music service account database, so there are tables for Artists, Albums, Tracks, Playlists, Customers, Employees, and Invoices as outlined in the Entity Relationship Diagram (ERD) below.

Check Out the Chinook Database on Codeplex

ERD can be found here

Queries

Look in the sql directory for all the SQL files and queries. Each file contains a specific data extraction objective.

Query Example (found in sql/26_top_3_artis.sql)

  • Provide a query that shows the top 3 best selling artists.
SELECT a.Name 'Artist', sum(li.UnitPrice) 'Total Sold' 
FROM InvoiceLine li, Track t, Album al, Artist a
WHERE li.TrackId = t.Trackid 
	and al.AlbumId = t.AlbumId 
	and a.ArtistId = al.ArtistId
GROUP BY a.Name
ORDER BY COUNT(a.ArtistId) DESC
limit 3;

About

Queries to the Chinook Database utilizing SQLite and DB Browser for query execution and database migration. The Chinook Dataset mimics a music service account database, so there are tables for Artists, Albums, Tracks, Playlists, Customers, Employees, and Invoices

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published