-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinitialize.sql
More file actions
27 lines (20 loc) · 871 Bytes
/
initialize.sql
File metadata and controls
27 lines (20 loc) · 871 Bytes
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
--How to Run:
-----------
--Initialize with: psql -U isdb -d postgres -f initialize.sql
--Run with: python us01-find-bug-comments.py
--or python us01-find-bug-comments-sql-fn.py
\c postgres
drop database if exists airbnb;
create database airbnb;
\c airbnb
\i create.sql
\copy Users FROM 'Users.csv' csv header;
\copy Guests FROM 'Guests.csv' csv header;
\copy Hosts FROM 'Hosts.csv' csv header;
\copy Products FROM 'Products.csv' csv header;
\copy Properties FROM 'Properties.csv' csv header;
\copy Experiences FROM 'Experiences.csv' csv header;
\copy Bookings(check_in_date,check_out_date,price,booking_status,updated_date,guest_id,product_id) FROM 'Bookings.csv' csv header;
\copy Messages(message_content,date,time,guest_id,host_id) FROM 'Messages.csv' csv header;
\copy Reviews FROM 'Reviews.csv' csv header;
\copy Saves FROM 'Saves.csv' csv header;