Created
July 1, 2020 02:00
-
-
Save ajkovar/d079980763b1e66fe9e774a39302779b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE users ( | |
id SERIAL PRIMARY KEY, | |
name VARCHAR(200) NOT NULL | |
); | |
insert into users (name) values ('bob'), ('tom'), ('jane'), ('mary'); | |
CREATE TABLE sales ( | |
id SERIAL PRIMARY KEY, | |
user_id int references users(id), | |
value bigint, | |
sold_on timestamptz | |
); | |
insert into sales | |
(user_id, value, sold_on) | |
values | |
(1, 200, '2020-06-22 19:10:25-07'), | |
(2, 300, '2020-06-18 19:10:25-07'), | |
(3, 340, '2020-06-12 14:10:25-07'), | |
(3, 450, '2020-06-21 9:10:25-07'), | |
(4, 250, '2020-06-20 19:10:25-07'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment