Database clients and servers
How SQL reaches a database
A database client sends a statement to the database engine and displays its result or an error. PostgreSQL normally uses a client-server architecture: a client such as psql connects to a running server. SQLite is an embedded engine; an application can open a database file or an in-memory database directly, without a separate database server.
Prepare your practice environment
Use a disposable empty database and execute the supplied shop-setup.sql script once. In SQLite, enable foreign key enforcement with PRAGMA foreign_keys = ON before setup and outside a transaction. For PostgreSQL, use a separate empty laboratory database; the setup is intended to be portable but has not been tested there. Do not run the reset script against an existing database.
Check your connection
Run the small statement below. SELECT requests a result; here it returns a constant rather than reading a table. Receiving 1 confirms that this statement ran, not that every database feature is supported. ByteMind live SQL execution has not been verified.
Try the examples
Static SQL — run in the prepared lab.
SELECT 1;Expected rows (JSON notation):
[[1]]