-
Notifications
You must be signed in to change notification settings - Fork 2
/
reviewDBFinal.sql
89 lines (82 loc) · 4.83 KB
/
reviewDBFinal.sql
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
drop table Comment;
drop table Imgs;
drop table Review;
drop table Restaurant;
drop table Users;
create table Users(
username varchar (20),
password varchar (30),
firstName varchar(20),
lastName varchar(50),
Primary Key(username)
);
create table Restaurant(
res_id numeric(10),
username varchar (20),
resName varchar (200),
resType varchar(50),
resAdd varchar(100),
road varchar(50),
province varchar(30),
resTel varchar(50),
resTime varchar(12),
Primary key(res_id),
Foreign Key (username) References Users(username)
);
create table Review(
review_id numeric (10),
username varchar (20),
res_id numeric(10),
topicReview varchar(100),
contentReview varchar (500),
taste numeric (1),
clean numeric (1),
service numeric (1),
look numeric (1),
worth numeric (1),
reviewDate date,
-- reviewDate varchar(10),
Primary Key (review_id),
Foreign Key (res_id) References Restaurant(res_id),
Foreign Key (username) References Users(username)
);
create table Imgs(
img_id numeric (10),
imgUrl varchar (200),
review_id numeric (10),
Primary Key (img_id),
Foreign Key (review_id) References Review(review_id)
);
create table Comment(
comment_id numeric (10),
contentComm varchar (500),
username varchar (20),
review_id numeric(10),
Primary Key (comment_id),
Foreign Key (username) References Users(username),
Foreign Key (review_id) References Review(review_id)
);
INSERT INTO Users(username,password,firstName,lastName) VALUES ('tanapat128','admin','Tanapat','Choochot');
INSERT INTO Users(username,password,firstName,lastName) VALUES ('nattakit126','admin','Nattakit','Sriyod');
INSERT INTO Users(username,password,firstName,lastName) VALUES ('songwit141','admin','Songwit','Buddee');
INSERT INTO Restaurant VALUES (1,'tanapat128','à¨ê¨ÔëÁ','µÒÁÊÑè§','¢éÒ§ÁËÒÅÑÂà·¤â¹Ï','¾Ø·¸ºÙªÒ','¡Ãا෾Ï','088-451-5663','8.00 - 19.00');
INSERT INTO Restaurant VALUES (2,'tanapat128','Bar-B-Q Plaza','ºØ¿à¿èµì','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4227','11:00-21:00');
INSERT INTO Restaurant VALUES (3,'songwit141','Shabushi','ºØ¿à¿èµì','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-8724483','11:00-21:00');
INSERT INTO Restaurant VALUES (4,'songwit141','Signature Steak Loft','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','095-208-0135','11:00-21:00');
INSERT INTO Restaurant VALUES (5,'songwit141','Farm Design','àºà¡ÍÃÕ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4512','11:00-21:00');
INSERT INTO Restaurant VALUES (6,'songwit141','Amor','àºà¡ÍÃÕ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4144','11:00-21:00');
INSERT INTO Restaurant VALUES (7,'songwit141','ZEN','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4188','11:00-21:00');
INSERT INTO Restaurant VALUES (8,'songwit141','Bonchon','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-416-9668','11:00-21:00');
INSERT INTO Restaurant VALUES (9,'songwit141','Sushi Boy','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4119','11:00-21:00');
INSERT INTO Restaurant VALUES (10,'songwit141','S&P','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4343','11:00-21:00');
INSERT INTO Restaurant VALUES (11,'songwit141','Starbucks','¡Òá¿/ªÒ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4271','11:00-21:00');
INSERT INTO Restaurant VALUES (12,'songwit141','Cold Stone Creamery','¢¹ÁËÇÒ¹','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','082-548-0028','11:00-21:00');
INSERT INTO Restaurant VALUES (13,'nattakit126','Santa fe Steak House','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02 872 4428','11:00-21:00');
INSERT INTO Restaurant VALUES (14,'nattakit126','¢¹Á¨Õ¹ºÒ§¡Í¡','ÀѵµÒ¤ÒÃ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02 872 4139','11:00-21:00');
INSERT INTO Restaurant VALUES (15,'nattakit126','Mr.Bun','àºà¡ÍÃÕ','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-834-6000','11:00-21:00');
INSERT INTO Restaurant VALUES (16,'nattakit126','AKA','ºØ¿à¿èµì','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-673-5597','11:00-21:00');
INSERT INTO Restaurant VALUES (17,'nattakit126','Hot Pot Buffet','ºØ¿à¿èµì','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4138','11:00-21:00');
INSERT INTO Restaurant VALUES (18,'nattakit126','MK Restaurant','ºØ¿à¿èµì','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-872-4138','11:00-21:00');
INSERT INTO Restaurant VALUES (19,'nattakit126','Daidomon','ºØ¿à¿èµì','Central Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02 872 4138','11:00-21:00');
INSERT INTO Restaurant VALUES (20,'nattakit126','Tenjo Sushi & Yakiniku','ºØ¿à¿èµì','The Bright Rama II','¾ÃÐÃÒÁ 2','¡Ãا෾Ï','02-007-5366','11:00-21:00');
INSERT INTO Review VALUES (1,'tanapat128',1,'Not Bad','I think it''s so dilicious',5,4,4,3,2,'2014-08-01');