Move Pak RT's village notebook into a real Postgres: INSERT, LIMIT, UPDATE, DELETE and VIEW. 16 levels, played right in the browser with nothing to install.
A database keeps its records in tables. A table is like a ruled page in a notebook: each row is one thing (here, one family), each column one kind of note about it (the house number, how many people). In this game a real PostgreSQL 18 runs in your browser. Each level makes a fresh database and runs your SQL. What is graded is what Postgres answers and stores, not how your SQL is written.
A primary key is a column whose value points to exactly one row, like a registration number. The database refuses a new row that uses a number already there, and a row with no number. That is a question a table can answer and a pile of notes cannot: is this family already written down?
INSERT adds a new row. The column list in brackets names the columns to fill, and the values in VALUES go into those columns in order. Text goes in single quotes ('Bu Sari'), numbers without quotes.
NULL means the value is missing or not known yet. It is not text and not zero, so it is found with IS NULL, not = ''. DEFAULT inside VALUES asks for the column's default value, set when the table was made (jiwa int DEFAULT 1).
One INSERT can add many rows: write several groups of values, separated by commas. The statement works whole: if one row is refused, none go in. A serial column hands out the next number itself when given DEFAULT.
LIMIT caps how many rows come back, OFFSET skips some rows first. Together they split a long list into pages, or into turns. $1 is a value sent when the query runs, here the night's number.