thecodex.expert · The Codex Family of Knowledge
SQL

Setup and Clients

There is no single "SQL runtime" to install — SQL only runs against a specific database engine, so the first decision is always which one.

SQL:2016 / ANSI Pick an engine first Last verified:
Canonical Definition

Unlike a general-purpose language, SQL has no standalone interpreter — it must run against a database engine, which stores the actual data and executes queries against it. Common engines include PostgreSQL and MySQL (client-server, need a running service), and SQLite (a single embedded file, no server at all). A client — a command-line tool like psql or mysql, or a GUI like DBeaver or TablePlus — connects to the engine and sends SQL statements to it.

SQLite: zero setup, a single file

For learning or a small local project, SQLite needs no server, no install of a background service, and no configuration — an entire database is one file on disk.

SQLterminal
$ sqlite3 mydata.db
sqlite> CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT);
sqlite> INSERT INTO users (name) VALUES ('Alice');
sqlite> SELECT * FROM users;
1|Alice

PostgreSQL and MySQL: client-server engines

These run as a background service (locally or on a remote server) that clients connect to over a network protocol, typically on a fixed port (5432 for PostgreSQL, 3306 for MySQL by default).

SQLterminal
$ psql -h localhost -U myuser -d mydatabase
mydatabase=# SELECT version();

Clients: command line vs GUI

psql (PostgreSQL) and mysql (MySQL) are the official command-line clients, scriptable and always available wherever the engine is installed. GUI tools (DBeaver, TablePlus, pgAdmin) add visual table browsing, query history, and schema diagrams — useful for exploration, though the underlying SQL is identical either way.

Sources

1
PostgreSQL Global Development Group. PostgreSQL Documentation, postgresql.org/docs, and SQLite Consortium, sqlite.org/docs.html.