CREATE TABLE orders (
id INTEGER PRIMARY KEY,
customer_id INTEGER NOT NULL REFERENCES customers(id) ON DELETE RESTRICT,
ordered_on TEXT NOT NULL,
status TEXT NOT NULL CHECK(status IN ('new','paid','cancelled')),
total_cents INTEGER NOT NULL CHECK(total_cents>=0)
);