-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathseed.sql
More file actions
32 lines (27 loc) · 1.06 KB
/
seed.sql
File metadata and controls
32 lines (27 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
-- =============================================================
-- Seed data for Section 06 — Foreign Keys
-- =============================================================
SET search_path TO adv_fks;
INSERT INTO customer (full_name, email) VALUES
('Ada Lovelace', 'ada@example.com'),
('Alan Turing', 'alan@example.com'),
('Grace Hopper', 'grace@example.com'),
('Margaret Hamilton', 'margaret@example.com');
INSERT INTO product (name, price_cents) VALUES
('Mechanical Keyboard', 12999),
('4K Monitor', 45900),
('USB-C Hub', 3499),
('Ergonomic Mouse', 5999),
('Webcam 1080p', 7499);
INSERT INTO "order" (customer_id, placed_at, total_cents) VALUES
(1, '2026-03-01 10:12:00+00', 18998),
(1, '2026-03-15 14:45:00+00', 45900),
(2, '2026-03-05 09:01:00+00', 9498),
(3, '2026-03-20 16:30:00+00', 7499);
INSERT INTO order_item (order_id, product_id, quantity) VALUES
(1, 1, 1), -- Ada: keyboard
(1, 4, 1), -- Ada: mouse
(2, 2, 1), -- Ada: monitor
(3, 3, 1), -- Alan: hub
(3, 4, 1), -- Alan: mouse
(4, 5, 1); -- Grace: webcam