Your Cart
Loading

Creating and Changing Data - Database Cheat Sheet

On Sale
$4.50
$4.50
Added to cart

Build a table, change its shape, then add, change and remove its rows. CREATE, ALTER and DROP, then INSERT, UPDATE and DELETE, the soft delete, and a transaction that undoes a mistake. Every step runs in order.


On the sheet:

- Shape or rows?: DDL against DML, on one real table

- CREATE TABLE: line by line, with its structure

- SQLite's types: and how to store dates and yes or no

- ALTER TABLE: add, rename and drop a column

- Create twice, drop safely: IF NOT EXISTS, and reading errors

- INSERT: name the columns, and DEFAULT

- UPDATE: read before you write

- DELETE, or a soft delete: remove a row, or keep the record

- Transactions: BEGIN, COMMIT and ROLLBACK


Two A4 pages, printed front and back, sized to print once and keep beside you while you work. Written in short sentences and plain English, for readers whose first language is not English and clearer for everyone else because of it.


It pairs with the Building Tables with SQL (DDL) and Adding & Changing Data (DML) books, so you can learn each idea in full and then revise it here in two pages.


Every query on this sheet was run against a live database before the page was printed, so the result you read is the result you get. Instant PDF download. By M.R. Sterling.

You will get a PDF (359KB) file