CREATE TABLE customers (
id uuid PRIMARY KEY,
email text UNIQUE NOT NULL,
name text
);
CREATE TABLE orders (
id uuid PRIMARY KEY,
customer_id uuid NOT NULL
REFERENCES customers(id),
total numeric(10,2)
);
CREATE TABLE order_items (
order_id uuid REFERENCES orders(id),
product_id uuid REFERENCES products(id),
quantity int NOT NULL
);
CREATE TABLE orders (
id uuid PRIMARY KEY,
customer_id uuid NOT NULL
REFERENCES customers(id),
total numeric(10,2)
);