-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.db.sql
209 lines (190 loc) · 5.4 KB
/
store.db.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
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
207
208
create table admin
(
Admin_username varchar(255) not null,
Password varchar(255) not null,
Admin_Email varchar(255) null,
Admin_Phone int null,
Admin_id int auto_increment
primary key
);
create table blog_post
(
Post_id int auto_increment
primary key,
Title varchar(255) not null,
Date datetime null,
Description varchar(255) null,
Post_Content varchar(255) null
);
create table book_selling
(
Book_Title varchar(255) null,
Book_id int auto_increment
primary key,
Description varchar(255) null,
Price int not null
);
create table client
(
Client_id int auto_increment
primary key,
Client_fname varchar(255) not null,
Client_sname varchar(255) not null,
Client_DOB date null,
Client_Addr varchar(255) null,
Client_Phone int null,
Client_Email varchar(255) null
);
create table contractor
(
Contractor_id int auto_increment
primary key,
Contractor_name varchar(255) null,
Contractor_job varchar(255) null,
Rate int not null
);
create table gallery_page
(
BA_Image_id int auto_increment
primary key,
Date datetime null,
Image_Attribute varchar(255) null,
Suburb int null,
Image_Comment varchar(255) null
);
create table home_page
(
Home_id int not null
primary key,
Content varchar(255) null
);
create table image
(
Image_id int auto_increment
primary key,
Image_Content varchar(255) null
);
create table blog_post_image
(
Blog_Post_image_id int auto_increment
primary key,
Image_id int null,
Post_id int null,
constraint Blog_Post_Image_pk_2
unique (Post_id, Image_id),
constraint Blog_Post_Image_blog_post_Post_id_fk
foreign key (Post_id) references blog_post (Post_id),
constraint Blog_Post_Image_image_Image_id_fk
foreign key (Image_id) references image (Image_id)
);
create table gallery_page_image
(
BA_Image_id int auto_increment
primary key,
Image_id int not null,
constraint Gallery_Page_Image_pk_2
unique (Image_id),
constraint Gallery_Page_Image_gallery_page_BA_Image_id_fk
foreign key (BA_Image_id) references gallery_page (BA_Image_id),
constraint Gallery_Page_Image_image_Image_id_fk
foreign key (Image_id) references image (Image_id)
);
create table job
(
Job_id int auto_increment
primary key,
Quote_id int not null,
Price int null,
Commence_Date date null,
Duration time null,
Job_Status varchar(255) null,
client_id int not null,
constraint Job_pk_Quote_id
unique (Quote_id),
constraint client_id
foreign key (client_id) references client (Client_id)
);
create table job_contractor
(
Job_id int auto_increment
primary key,
Contractor_id int not null,
constraint Job_Contractor_pk_2
unique (Contractor_id),
constraint Job_Contractor_Contractor_id_fk
foreign key (Contractor_id) references contractor (Contractor_id),
constraint Job_Contractor_job_id_fk
foreign key (Job_id) references job (Job_id)
);
create table post_comment
(
Post_Comment_id int auto_increment
primary key,
User_Name varchar(255) null,
User_Email varchar(255) null,
Comment_Details varchar(255) null,
Post_id int null,
constraint Post_Comment_pk_2
unique (Post_id),
constraint Post_Comment_blog_post_Post_id_fk
foreign key (Post_id) references blog_post (Post_id)
);
create table request
(
Request_No int auto_increment
primary key,
Request_Email varchar(255) not null,
Cust_Fname varchar(255) null,
Cust_Sname varchar(255) null,
Subscription varchar(255) null,
constraint Request_pk_2
unique (Request_Email)
);
create table review
(
Review_id int auto_increment
primary key,
Client_Name varchar(255) not null,
Month_Year datetime null,
Suburb int null,
Review_Details varchar(255) null
);
create table service
(
Serv_id int auto_increment
primary key,
Serv_Title varchar(255) not null,
Serv_Description varchar(255) null,
Serv_Detail varchar(255) not null
);
create table job_service
(
Job_id int auto_increment
primary key,
Serv_id int not null,
constraint Job_Service_pk_2
unique (Serv_id),
constraint Job_Service_job_Job_id_fk
foreign key (Job_id) references job (Job_id),
constraint Job_Service_service_Serv_id_fk
foreign key (Serv_id) references service (Serv_id)
);
create table service_image
(
Serv_image_id int auto_increment
primary key,
Image_id int null,
Serv_id int null,
constraint Service_Image_pk_2
unique (Serv_image_id, Serv_id),
constraint Service_Image_image_Image_id_fk
foreign key (Image_id) references image (Image_id),
constraint Service_Image_service_Serv_id_fk
foreign key (Serv_id) references service (Serv_id)
);
create table transaction
(
Transaction_id int auto_increment
primary key,
Payment_details varchar(255) null
);