-
Notifications
You must be signed in to change notification settings - Fork 1
/
amazondatabase
60 lines (47 loc) · 1.99 KB
/
amazondatabase
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
CREATE DATABASE amazondatabase;
Create TABLE `Item` (
`Name` varchar(40),
`Price` INT, /*Or decimal, will look up*/
`Description` varchar(70),
`Item_id` varchar(10),
Primary Key (Item_id)
);
CREATE TABLE `Account` (
`Pass` CHAR(15),
`Type` VARCHAR(10),
`Account_id` INTEGER,
`Username` VARCHAR(20),
`Email` VARCHAR(20),
PRIMARY KEY (Account_id)
);
Create TABLE `CartEntry` (
`ID` INTEGER NOT NULL AUTOINCREMENT,
`Total` INT,
`Item_id` INTEGER,
`Account_id` INTEGER,
`NumItems` INT,
PRIMARY KEY (Instance_id)
);
Create TABLE `ItemReview` (
`Rating` INT,
`Item_id` VARCHAR(100),
`Description` VARCHAR(100),
PRIMARY KEY (Rating)
);
/*------------------------------------User 1------------------------------*/
INSERT INTO `Account` VALUES ('LeslieIsPrime','admin','1','Leslie1','[email protected]');
/*------------------------------------User 2------------------------------*/
INSERT INTO `Account` VALUES ('GouriIsPrime','user','23','Gouri2','[email protected]');
/*------------------------------------User 3------------------------------*/
INSERT INTO `Account` VALUES ('TroyIsPrime','user','20','Troy3','[email protected]');
/*------------------------------------User 4------------------------------*/
INSERT INTO `Account` VALUES ('ThomasIsPrime','user','10','Thomas4','[email protected]');
/*------------------------------------User 5------------------------------*/
INSERT INTO `Account` VALUES ('WarrenIsPrime','user','21','Warren5','[email protected]');
/*-------------------------------------------ITEM ONE------------------------------*/
INSERT INTO `Item` VALUES ('temp', '12', 'Will be replaced later.', '27');
INSERT INTO `Item` VALUES ('earplugs', '8', 'Every college student needs one.', '19');
/*-------------------------------------------REVIEW ONE------------------------------*/
INSERT INTO `ItemReview` VALUES ('5', '27', 'Great item!');
INSERT INTO `ItemReview` VALUES ('4', '19', 'I can now sleep peacefully at night.');