Sunday, January 04, 2009

Chinook Database 1.1 Released

I just released a new version of the Chinook Database. Chinook Database is a sample database that represents a digital media store, like iTunes, including information of artists, albums, tracks, media type, invoices, customers, etc. The media information was imported from my iTunes library, the customer/employee info was created manually, and the sales info is auto-generated for a 4 years period.

It supports Oracle, MySQL, SQL Server and SQL Server Compact. The database can be created by running a single SQL script. It is also provided as an XML file and a SQL Server Compact database. It is possible to use your own iTunes library information to regenerate these scripts, see more details here.

The SQL scripts and unit tests are auto-generated using T4 templates by reading the tables information defined in an XML schema.

The new changes for the release 1.1 are:
  • Support for SQL Server Compact.
  • Additional customers from multiple countries.
  • Added a many-to-many relationship (a Playlist contains many Tracks, a Track belongs to many Playlists).
  • Added a one-to-many relationship between Employee and Customer (support representative).
  • Added Total field to invoice table.
I also created more unit tests to validate the data created in the database after running the SQL scripts.

The new schema is:



You can download this new version from the Chinook Database 1.1 Release page.

2 comments:

Evoluteur said...

Feature requests:
- script to drop all tables (because it needs to drop ref integrity first).
- triggers to update order total.
- a few records in Chinese or Japanese

Luis Rocha said...

Thanks, Evoluteur!

I will add these requests for the next release.

Cheers,
Luis