If you need a sample database to run some quick tests in SQLite, here are a couple of options.
1. The Chinook Database
The Chinook database was created as an alternative to the Northwind database. It represents a digital media store, including tables for artists, albums, media tracks, invoices and customers.
SQLite is famous for its great feature zero-configuration, which means no complex setup or administration is needed. This chapter will take you through the process of setting up SQLite on Windows, Linux and Mac OS X. Install SQLite on Windows. Step 1 − Go to SQLite download page, and download precompiled binaries from Windows section. For example, Mac OS X comes pre-isntalled with SQLite and can be executed using the sqlite3 command. However, you may need to install SQLite in some cases and on other OSes. How to Install SQLite On Mac. SQLite comes preinstalled on Mac, so you can simply open the terminal application and type sqlite3 to launch the server. Mac Machine SQLite Installation Instructions. Download sqlite from download page; Unzip file; Use terminal to navigate to the location of the file; Enter code “mv sqlite3 /usr/local/bin/” If sqlite is downloaded, you should see a sqlite command that looks like “sqlite” Test your new sqlite installation by typing “newdb.sqlite”. DB Browser for SQLite. The Official home of the DB Browser for SQLite. DB Browser for SQLite (DB4S) is a high quality, visual, open source tool to create, design, and edit database files compatible with SQLite. DB4S is for users and developers who want to create, search, and edit databases. It supports all popular major relational database systems MySQL, PostgreSQL, Oracle, DB2, SQL Server, Sybase. Including SQLite. DB Browser for SQLite – is an open-source tool to manage database files compatible with SQLite. In this tutorial, you have learned how to download and install SQLite tools on your computer.
The Chinook database is available on GitHub. It’s available for various DBMSs including MySQL, SQL Server, SQL Server Compact, PostgreSQL, Oracle, DB2, and of course, SQLite.
Install the Chinook Database
You can install the Chinook database in SQLite by running the SQL script available on GitHub. It’s quite a large script, so you might find it easier to run it from a file.
First, save the Chinook_Sqlite.sql script to a folder/directory on your computer. That’s a direct link to the script on GitHub.
![Download Download](/uploads/1/2/4/3/124344720/750547074.png)
Now create a database called Chinook. You can do this by connecting to SQLite with the following command:
Now you can run the script. To run it from the file, use the following command:
This assumes that you’re in the same directory as the file, and that the file is called Chinook_Sqlite.sql. If not, you’ll need to use the full path to the file, along with whatever you’ve called the file.
Running this script creates the database tables and populates them with data.
Once the script has finished running, you can verify that it created the database by selecting some data from a table. For example, you could run the following:
Result:
2. The Northwind Database
You can do exactly the same thing with the Northwind database. In fact, the Chinook database was created as a newer alternative to the Northwind database.
The Northwind database has been available for SQL Server and Microsoft Access for years. It was provided as a tutorial database for managing small business customers, orders, inventory, purchasing, suppliers, shipping, and employees.
Github has a version of the Microsoft Access 2000 Northwind sample database, re-engineered for SQLite3.
So, similar to the previous example, save the SQL script available on GitHub as Northwind_Sqlite.sql.
Now connect to SQLite and create a database called Northwind:
Now you can run the script:
This will create the tables and populate them, etc. You’ll probably see the data flash by as the script as it’s running.
In any case, once it’s finished running, you can run a quick check by selecting some data. For example:
Sqlite Mac Download
Result:
- Step 1 – Visit SqLite – official download page. Search for “Precompiled Binaries for Windows” Section.
- Step 2 – Download the zip file called sqlite-dll-win32-x86-xxxx.zip or sqlite-dll-win64-x64-xxxx.zip depending upon your system configuration.
- Step 3 – Also download sqlite-tools-win32-x86-xxxx.zip fron tahe same place.
- Step 4 – Create a folder in your C directory called sqlite. In C:sqlite unzip both the files which you have downloaded.
- Step 5 – Now you C:sqlite folder will contain the following files246SQLite version3.13.02016-05-1810:57:30Connected toatransient in-memory database.Use'.open FILENAME'toreopen onapersistent database.
![Mac Mac](/uploads/1/2/4/3/124344720/293289134.jpg)
Now a days Most of the Linux distributions , if not all, are being shipped with Sqlite. So before installing Sqlite manually, its not a bad idea to check if the sqlite is installed on your linux system or not.
So open your terminal and type sqlite3 in it. If you the the following result on terminal then sqlite is already present on yout Linux operating system.
Mac Sqlite3
2 4 6 | SQLite version3.13.02016-05-1810:57:30 Connected toatransient in-memory database. Use'.open FILENAME'toreopen onapersistent database. |
If in case sqlite is not installed on your system, the you can also install SQLite from Source on Linux
So open your terminal and type the following commands to install it
2 4 6 | SQLite version3.13.02016-05-1810:57:30 Connected toatransient in-memory database. Use'.open FILENAME'toreopen onapersistent database. |
If in case sqlite is not installed on your system, the you can also install SQLite from Source on Mac OS X
So open your terminal and type the following commands to install it