SQL practice across related data calls for a database with connected tables. Chinook is a sample digital music store database whose tables connect related records.
In this piece, I’ll show you how to download and open the SQLite file, then run a query against it.
TL;DR: Chinook Database Download
Download the SQLite database file from the Chinook project, then open it with the sqlite3 command-line tool.
- SQLite file: Chinook_Sqlite.sqlite
- Open it with sqlite3 Chinook_Sqlite.sqlite.
- Run .tables to inspect the schema.
What Is the Chinook Database?
Chinook is a sample database for a digital music store. Its tables connect artists to albums, albums to tracks, and customers to invoices, so a query can join related records.
The project supplies variants for several database engines, including SQLite. I focus on the SQLite file because it opens directly in sqlite3.
Use the SQLite file when your tool opens SQLite databases. The repository also contains SQL scripts for other engines. A script contains instructions for creating a database.
The .sqlite file is already a database you can open. The project’s README lists supported engines and describes its data model.
The GitHub repository keeps database files under its ChinookDatabase/DataSources directory. Its history and folder view help identify where a file came from, while the project README explains what Chinook models. I use the SQLite file from that directory rather than a release script because the goal here is to open an existing SQLite database.
Track shows how the sample connects media data. Its schema includes TrackId, Name, AlbumId, MediaTypeId, GenreId and Milliseconds. These columns let a query filter tracks by album, genre or media type without changing the sample data.
How to Download and Open the Chinook Database
Download the SQLite artifact, place it in a working directory, then ask SQLite to list its tables. I used the repository’s SQLite file and checked it with the sqlite3 CLI.
Step 1: Get the SQLite database file
Open the file link in the quick answer and choose the download option on GitHub. Save the file as Chinook_Sqlite.sqlite.
Keep the extension. It identifies the artifact as a SQLite database and avoids confusion with a vendor-specific SQL script.
Step 2: Open the database
Run this command from the directory containing the downloaded file. SQLite opens the named database and starts its interactive prompt.
sqlite3 Chinook_Sqlite.sqlite
The SQLite CLI prints its version and shows a prompt. I used the local file to run the next checks. Its integrity check returned ok.
Step 3: List the tables
At the sqlite> prompt, enter the CLI dot-command .tables. It lists the tables available in the database.
Album Employee InvoiceLine PlaylistTrack Artist Genre MediaType Track Customer Invoice Playlist
The names are singular and use capital letters in this file, such as Track and Artist. SQLite treats unquoted table names without regard to case. Use the spelling shown when you read the schema.
Step 4: Run a query
Query the Track table to count its rows. The CLI accepts a SQL statement after the database filename. It exits after printing the result.
sqlite3 Chinook_Sqlite.sqlite 'SELECT COUNT(*) AS tracks FROM Track;'
3503

The result is the number of rows in Track in this downloaded file. To continue learning SQLite syntax, see the SQLite SQL language reference and the SQLite SELECT guide.
Chinook Database Download and SQLite Errors
Match the symptom to the file or command before retrying. I check the filename first because sqlite3 creates a new empty database when a requested path does not exist.
| Case | Symptom | Fix |
|---|---|---|
| Missing file | sqlite3 opens an empty database | Run ls -l Chinook_Sqlite.sqlite and download the file if absent |
| Wrong artifact | SQL script targets another database engine | Choose Chinook_Sqlite.sqlite from the SQLite data source |
| Different table names | A tutorial query cannot find its table | Run .tables and use the names listed by your copy |
Conclusion: Choose the SQLite Database File
For SQLite practice, download the Chinook .sqlite file from the project’s data sources, open it with sqlite3, and inspect the tables before writing queries. That check confirms you are working with the sample database rather than an empty file or a script for another engine.
FAQ
These answers cover the file format, tool and first verification check.
Is the Chinook database free?
The Chinook project publishes its sample database and source files on GitHub. Check the repository license for terms that apply to your use.
How do I open the Chinook SQLite database?
Run sqlite3 Chinook_Sqlite.sqlite from the directory containing the downloaded file, then use .tables to list its tables.
How many tables are in this Chinook SQLite file?
The checked file lists 11 tables with the sqlite3 .tables command.
