This directory contains scripts to create the "Northwind" database, which a subset of the classic Microsoft sample db. The scripts for creating it were copied from the SQL tutorial site dofactory and adapted for different database dialects.
The scripts assume one of:
- MS SQL Server / SQL Express
- Mysql
- Postgres
- SQLite
There is a pair of scripts for each of the above dialects (mssql | mysql | postgres | sqlite). If you are using a different database server, you will need to adapt the scripts accordingly.
-
Copy contents of the
dbscripts
folder from the sample repo into your owndbscripts
folder. -
Use the administration tool for your DBMS to create a database named "Northwind".
- mssql: SQL Server Management Studio
- mysql: MySQL Workbench
- postgres: pgAdmin
- sqlite: sqlite3 CLI or see next section
-
Open and run the script to create the tables,
dbscripts\{dialect}-sample-model.sql
. -
Open and run the script to insert the data,
dbscripts\{dialect}-sample-data.sql
For Sqlite, there is a nodejs script included to create a local database. This assumes that you already have nodejs and npm installed.
In this dbscripts
directory, run the following:
npm install sqlite3
node sqlite-import
This will create a database file, northwind.sqlite
, in the parent directory.