Lab 4: SQL Installation and Tutorial

This lab is designed to help you set up SQLite on your computer, and to help you practice writing SQL queries.

You should work on this assignment individually.

Instructions

Task 1: Install SQLite

First, check whether you already have SQLite installed by trying to run SQLite from the command line. Notice that the command is named sqlite3:

pstory@Gray-MBP ~> sqlite3 --help
Usage: sqlite3 [OPTIONS] FILENAME [SQL]
FILENAME is the name of an SQLite database. A new database is created
if the file does not previously exist.
OPTIONS include:
   -A ARGS...           run ".archive ARGS" and exit
   -append              append the database to the end of the file
   -ascii               set output mode to 'ascii'
   -bail                stop after hitting an error
...

If you get an error, then you need to install SQLite.

You can either download SQLite directly from the developers, or install it through a package manager. For example, it is available form MacPorts and Homebrew on MacOS, and from apt on Linux.

Task 2: SQLite CLI Tutorial

Task 3: Install a SQLite GUI

For example, DB Browser for SQLite.

After installing it, use it to view the company.db database.

Submit

You should upload a PDF to Moodle containing:

  1. A screenshot of a query issued from the SQLite command-line
  2. A screenshot of company.db loaded by a SQLite GUI application

The assignment will only be graded for completion.