📦 Installation

Installation: SQL setup varies dramatically depending on the database engine you choose — SQLite needs just one library, while PostgreSQL requires starting a server process, crea

SQL setup varies dramatically depending on the database engine you choose — SQLite needs just one library, while PostgreSQL requires starting a server process, creating users, and configuring connection parameters. But how do you decide between 'simplest' and 'closest to production'? SQLite stores the entire database in a single file — like serializing a Java ArrayList to a .ser file and reading it back; no server, no port, no password. PostgreSQL has a full client-server architecture; just like opening a JDBC connection with DriverManager requires a URL, username, and password, setting up PostgreSQL demands the same concepts. For a QA engineer this difference is critical: SQLite is enough for fast, dependency-free data verification in a CI/CD pipeline, but integration tests that mirror the real production database require PostgreSQL setup — choosing the wrong engine can lead to green tests but production failures.

Option A: Zero-Install Online Editors (Start Here)

Option B: SQLite CLI (Lightest Local Option)

Micro Lab: SQL — Table creation

Replace the TODO line with the critical line from the expected solution. This is not a real runtime; the goal is to reinforce writing the correct structure in a controlled way.

What Actually Happens When You Run sqlite3 mytest.db?

The moment the command runs, if the file DOESN'T exist…

The moment sqlite3 mytest.db runs, if mytest.db doesn't exist on disk yet, a brand-new empty file is created — there's no separate "create database" command.

Commands starting with a dot (.)…

Commands starting with a dot (.tables, .schema, .headers) are SQLite's OWN commands — they are not part of the SQL standard and will NOT work in MySQL/PostgreSQL.

.headers on and .mode column…

.headers on and .mode column only change how results are DISPLAYED in the terminal — they never touch the actual data, they just make output readable.

SELECT sqlite_version(), without a dot…

SELECT sqlite_version(), with no leading dot, is a standard SQL query — it ends with a semicolon and has an equivalent (under a different function name) in every SQL engine.

Installation steps

  1. Windows: Download "sqlite-tools-win32" from sqlite.org/download.html and extract to C:\sqlite\
  2. Mac: Already installed! Run: sqlite3 —— or install via Homebrew: brew install sqlite
  3. Linux: sudo apt install sqlite3
  4. Create a database: sqlite3 mytest.db
  5. Verify: SELECT sqlite_version();