This repository has been archived by the owner on Mar 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tourism_recommendation.sql
100 lines (91 loc) · 2.89 KB
/
tourism_recommendation.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
90
91
92
93
94
95
96
97
98
99
create table admin
(
id int auto_increment
primary key,
firstName varchar(100) not null,
lastName varchar(100) not null,
username varchar(100) not null,
email varchar(100) not null,
password varchar(100) not null,
gender varchar(100) not null,
role varchar(100) null
);
create table destination
(
id int auto_increment
primary key,
name varchar(100) not null,
location varchar(100) not null,
description varchar(10000) not null,
image varchar(100) not null
);
create table event
(
id int auto_increment
primary key,
eventName varchar(100) not null,
location varchar(100) not null,
date date null,
description varchar(10000) not null,
image varchar(100) not null
);
create table feedback
(
id int auto_increment
primary key,
datetime timestamp default CURRENT_TIMESTAMP not null,
user_id int not null,
feedback text not null
);
create table user
(
id int auto_increment
primary key,
firstName varchar(100) not null,
lastName varchar(100) not null,
username varchar(100) null,
email varchar(100) not null,
password varchar(100) null,
gender varchar(100) not null
);
create table destination_rating_info
(
id int auto_increment
primary key,
user_id int null,
destination_id int null,
rating_action varchar(10) null,
constraint destination_id
foreign key (destination_id) references destination (id)
on update cascade on delete cascade,
constraint user_id
foreign key (user_id) references user (id)
on update cascade on delete cascade
);
create table destination_review
(
id int auto_increment
primary key,
user_id_fk int not null,
destination_id_fk int not null,
review text not null,
datetime timestamp default CURRENT_TIMESTAMP not null,
constraint destination_id_fk
foreign key (destination_id_fk) references destination (id)
on update cascade on delete cascade,
constraint user_id_fk
foreign key (user_id_fk) references user (id)
on update cascade on delete cascade
);
create table user_post
(
id int auto_increment
primary key,
datetime timestamp default CURRENT_TIMESTAMP not null,
user_id int null,
title varchar(100) not null,
post text null,
image varchar(100) null
);
create index user_id
on user_post (user_id);