Chapter 1
Exercise 0: The Setup
This book will use SQLite3 as a training tool. SQLite3 is a complete database system
that has the advantage of requiring almost no setup. You just download a binary and
work it like most other scripting languages. Using this, you'll be able to learn
SQL without getting stuck in the administrivia of administering a database
server.
Installing SQLite3 is easy:
- Either go to their downloads page and grab the binary for your platform.
Look for "Precompiled Binaries for X" with X being your operating
system of choice.
- Use your operating system's package manager to install it. If you're on
Linux then you know what that means. If you're on OSX then first go get
a package manager and then use it to install sqlite3.
When you've got it installed, then make sure you can start up a command line and
run it. Here's a quick test for you to try:
1$ sqlite3 test.db 2SQLite version 3.7.8 2011-09-19 14:49:19 3Enter ".help" for instructions 4Enter SQL statements terminated with a ";" 5sqlite> create table test (id); 6sqlite> .quit
Then look to see that the test.db file is there. If that works then you're
all set. You should make sure that your version of SQLite3 is the same as
the one I have here: 3.7.8. Sometimes things won't work right with older
versions.
1.1 Additional Tools You'll Need
You will also need to have the following additional tools:
- A good plain text editor. Use anyone you like, but do not use an IDE
(Integrated Development Environment). They cannot help you.
- Familiarity with your command line (aka Terminal, aka cmd.exe). You'll
be running commands from there.
- An internet connection with a web browser so you can look up
documentation and research things I tell you to find.
Once you have that all setup you are ready to go.
1.2 Extra Credit
- Go to the SQLite3 site again and browse around through the
documentation.