-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
40 lines (35 loc) · 1019 Bytes
/
Copy pathschema.sql
File metadata and controls
40 lines (35 loc) · 1019 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
DROP DATABASE IF EXISTS airbnb;
CREATE DATABASE airbnb;
\c airbnb;
CREATE TABLE IF NOT EXISTS lodgeInfo (
id SERIAL PRIMARY KEY,
entireLodge BOOLEAN NOT NULL,
type varchar(255) NOT NULL,
maxGuests int NOT NULL,
bedroom int NOT NULL,
beds int NOT NULL,
bath int NOT NULL
);
CREATE TABLE IF NOT EXISTS listings (
id SERIAL PRIMARY KEY,
hostname varchar(255) NOT NULL,
hostimg varchar(255) NOT NULL,
lodgename varchar(255) NOT NULL,
lodgeInfoId int NOT NULL,
superhost BOOLEAN NOT NULL,
enhancedClean BOOLEAN NOT NULL,
description text,
desSpace text,
guestAccess text,
otherThings text,
checkIn varchar(4) NOT NULL,
checkOut varchar(4) NOT NULL,
selfCheckIn BOOLEAN NOT NULL,
kidFriendly BOOLEAN NOT NULL,
infantFriendly BOOLEAN NOT NULL,
pets BOOLEAN NOT NULL,
smoking BOOLEAN NOT NULL,
partiesEvents BOOLEAN NOT NULL,
additionalRules varchar(500),
FOREIGN KEY (lodgeInfoId) REFERENCES lodgeInfo(id)
);