-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOur Project - Plan.txt
206 lines (178 loc) · 7.3 KB
/
Our Project - Plan.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
Users
UserID (PK)
First Name
Last Name
Address
DOB [must be 18+]
Occupation
SIN
Type
Renter
Host
PaymentInfo [only for renter]
Listings
ListingID
Type
House
Apartment
Guesthouse
Hotel
Longitude
Latitude
Address
postal code
city
country
Price [per night] ?
Availability
Pricing
ListingID
Price
StartDate
EndDate ???
Amenities
Listing ID
Type
Wifi
Hot water
...
Status (Avail / Not Avail)
Booking
Renter
Listing
StartDate
EndDate
Cost
Status
Active
Complete
Cancelled by host
Cancelled by renter
Blocked by host
Comment
CommentId
FromUser
ToUser
Rating
Comment
OPERATIONS
Create/delete user
Cancel Booking by renter or host
Remove listing by host
Create booking by renter
Change price of listing
Book a listing if available
Comment only if valid
QUERIES
Listings for a specific logitude latitude within constant distance
Order by price, ascending or descending
Search listing by Address (Street address, country, postal code)
Filter search by availiability given date range
REPORTS
Total number of bookings in a specific date range by city/zip code
Total number of listings given country, city, postal code
Rank hosts by listings overall per country/city
Report hosts who have more than 10% of listings in city/country
Rank renters by bookings over a time period/ city (minimmum 2 bookings)
Rank hosts and renters by most cancellation per year
Report noun phrases based on popularity for a listing
TOOLKIT
Suggest price for listing
Suggest amenities host may like to add with estimated revenue increase
CREATE TABLE `User` (
`UserId` INT NOT NULL AUTO_INCREMENT,
`Username` VARCHAR(255) NOT NULL,
`Password` VARCHAR(255) NOT NULL,
`Name` VARCHAR(255) NOT NULL,
`Address` VARCHAR(255) NOT NULL,
`DOB` DATE NOT NULL,
`Occupation` VARCHAR(255) NOT NULL,
`SIN` INT NOT NULL,
`Type` CHAR NOT NULL,
`PaymentInfo` VARCHAR(255) NOT NULL,
PRIMARY KEY (`UserId`)
);
CREATE TABLE `Listing` (
`ListingID` INT NOT NULL AUTO_INCREMENT,
`Renter` INT NOT NULL,
`Type` VARCHAR(255) NOT NULL,
`Address` VARCHAR(255) NOT NULL,
`PostalCode` VARCHAR(255) NOT NULL,
`Longitude` FLOAT NOT NULL,
`latitude` FLOAT NOT NULL,
`City` VARCHAR(255) NOT NULL,
`Country` VARCHAR(255) NOT NULL,
PRIMARY KEY (`ListingID`)
);
CREATE TABLE `Pricing` (
`ListingID` INT NOT NULL,
`Price` FLOAT NOT NULL,
`StartDate` DATE NOT NULL,
`EndDate` DATE,
PRIMARY KEY (`ListingID`, `StartDate`)
);
CREATE TABLE `Amenities` (
`ListingID` INT NOT NULL,
`Type` VARCHAR(255) NOT NULL,
PRIMARY KEY (`ListingID`, `Type`)
);
CREATE TABLE `ListingComment` (
`CommentID` INT NOT NULL AUTO_INCREMENT,
`FromUser` INT NOT NULL,
`ListingID` INT NOT NULL,
`Rating` INT NOT NULL,
`Comment` VARCHAR(255) NOT NULL,
PRIMARY KEY (`CommentID`)
);
CREATE TABLE `RenterComment` (
`CommentID` INT NOT NULL AUTO_INCREMENT,
`FromUser` INT NOT NULL,
`ToUser` INT NOT NULL,
`Rating` INT NOT NULL,
`Comment` VARCHAR(255) NOT NULL,
PRIMARY KEY (`CommentID`)
);
CREATE TABLE `Booking` (
`BookingID` INT NOT NULL AUTO_INCREMENT,
`ListingID` INT NOT NULL,
`Renter` INT NOT NULL,
`StartDate` DATE NOT NULL,
`EndDate` DATE NOT NULL,
`Cost` FLOAT NOT NULL,
`Status` VARCHAR(255) NOT NULL,
PRIMARY KEY (`BookingID`)
);
INSERT INTO `MyBnB`.`Users` (`id`, `username`, `password`, `first_name`, `last_name`, `address`, `dob`, `occupation`, `SIN`, `type`, `payment_info`)
VALUES (null, 'ShadmanT', 'shad', 'Shadman', 'Tajwar', 'BFFLane', '2002-01-04', 'student', '1423', 'r', '12345678');
INSERT INTO `MyBnB`.`Users` (`id`, `username`, `password`, `first_name`, `last_name`, `address`, `dob`, `occupation`, `SIN`, `type`, `payment_info`)
VALUES (null, 'Maanoboy', 'arielle', 'Maaneth', 'DeSilva', 'HollandVista', '2002-12-25', 'student', '123', 'h', null);
INSERT INTO `MyBnB`.`Users` (`id`, `username`, `password`, `first_name`, `last_name`, `address`, `dob`, `occupation`, `SIN`, `type`, `payment_info`)
VALUES (null, 'Rajeev', 'raj', 'Rajeev', 'Ramgoolie', 'Trinidad', '2003-08-07', 'student', '123', 'r', 1234556);
INSERT INTO `MyBnB`.`Users` (`id`, `username`, `password`, `first_name`, `last_name`, `address`, `dob`, `occupation`, `SIN`, `type`, `payment_info`)
VALUES (null, 'Arielle', 'maano', 'Arielle', 'Ramgoolie', 'Scarborough', '2000-09-27', 'student', '123', 'h', null);
INSERT INTO `MyBnB`.`Listings` (`id`, `host_id`, `type`, `longitude`, `latitude`, `address`, `price`) VALUES (null, 'house', '1', '6.5', '6.5', 'markham road', '45');
INSERT INTO `MyBnB`.`Listings` (`id`, `host_id`, `type`, `longitude`, `latitude`, `address`, `price`) VALUES (null, 'apartment', '1', '44.5', '232.4', 'north york', '50');
INSERT INTO `MyBnB`.`Listings` (`id`, `host_id`, `type`, `longitude`, `latitude`, `address`, `price`) VALUES (null, 'hotel', '3', '77.7', '43.4', 'scarborough gulf club', '100');
INSERT INTO `MyBnB`.`Listings` (`id`, `host_id`, `type`, `longitude`, `latitude`, `address`, `price`) VALUES (null, 'apartment', '3', '66.7', '44.4', 'military trail', '50');
INSERT INTO `MyBnB`.`Listing` (`Host`, `Type`, `Address`, `PostalCode`, `Longitude`, `latitude`, `City`, `Country`) VALUES ('2', 'Full house', '12 bnb drive', 'L2NT3G', '123123.134', '23423.123', 'Paris', 'France');
INSERT INTO `MyBnB`.`Listing` (`Host`, `Type`, `Address`, `PostalCode`, `Longitude`, `latitude`, `City`, `Country`) VALUES ('2', 'Full house', '13 bnb drive', 'L2NT3G', '123125.134', '23423.123', 'Paris', 'France');
INSERT INTO `MyBnB`.`Listing` (`Host`, `Type`, `Address`, `PostalCode`, `Longitude`, `latitude`, `City`, `Country`) VALUES ('4', 'Apartment', '12 mornelle ct apt 10', 'L6A3L3', '12312.134', '23423.123', 'Toronto', 'Canada');
INSERT INTO `MyBnB`.`Listing` (`Host`, `Type`, `Address`, `PostalCode`, `Longitude`, `latitude`, `City`, `Country`) VALUES ('4', 'Apartment', '13 mornelle ct apt 10', 'L6A3L3', '12312.134', '23423.123', 'Toronto', 'Canada');
INSERT INTO `MyBnB`.`Pricing` (`ListingID`, `Price`, `StartDate`) VALUES ('1', '234.99', '2021-12-2');
INSERT INTO `MyBnB`.`Pricing` (`ListingID`, `Price`, `StartDate`) VALUES ('2', '42342', '2022-05-24');
INSERT INTO `MyBnB`.`Pricing` (`ListingID`, `Price`, `StartDate`) VALUES ('3', '23.99', '2021-12-2');
INSERT INTO `MyBnB`.`Pricing` (`ListingID`, `Price`, `StartDate`) VALUES ('4', '423.54', '2022-05-24');
INSERT INTO `MyBnB`.`Pricing` (`ListingID`, `Price`, `StartDate`, `EndDate`) VALUES ('4', '400', '2021-05-23', '2022-05-23');
INSERT INTO `MyBnB`.`Amenities` VALUES (1, 'Toilet Paper');
INSERT INTO `MyBnB`.`Amenities` VALUES (2, 'Toilet Paper');
INSERT INTO `MyBnB`.`Amenities` VALUES (3, 'Toilet Paper');
INSERT INTO `MyBnB`.`Amenities` VALUES (4, 'Toilet Paper');
INSERT INTO `MyBnB`.`Amenities` VALUES (1, 'Wifi');
INSERT INTO `MyBnB`.`Amenities` VALUES (2, 'Wifi');
INSERT INTO `MyBnB`.`Amenities` VALUES (3, 'Wifi');
INSERT INTO `MyBnB`.`Amenities` VALUES (4, 'Wifi');
INSERT INTO `MyBnB`.`Amenities` VALUES (1, 'Heating');
INSERT INTO `MyBnB`.`Amenities` VALUES (4, 'Heating');
INSERT INTO `MyBnB`.`Amenities` VALUES (1, 'Air Conditioning');
INSERT INTO `MyBnB`.`Amenities` VALUES (2, 'Air Conditioning');
INSERT INTO `MyBnB`.`Amenities` VALUES (3, 'Air Conditioning');