-
Notifications
You must be signed in to change notification settings - Fork 1
/
medicaldb.sql
508 lines (413 loc) · 14.1 KB
/
medicaldb.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 11, 2023 at 03:41 PM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `is`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE `admin` (
`Admin_ID` int(11) NOT NULL,
`User_Name` varchar(50) NOT NULL,
`First_Name` varchar(50) DEFAULT NULL,
`Last_Name` varchar(50) DEFAULT NULL,
`Password` varchar(50) DEFAULT NULL,
`Last_login` date DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `admin`
--
INSERT INTO `admin` (`Admin_ID`, `User_Name`, `First_Name`, `Last_Name`, `Password`, `Last_login`, `Email`) VALUES
(1, 'Praveen123', 'Praveen', 'Silva', 'admin123', '2023-05-26', '[email protected]');
-- --------------------------------------------------------
--
-- Table structure for table `appointment`
--
CREATE TABLE `appointment` (
`appointment_ID` int(10) NOT NULL,
`name` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`doctor` varchar(100) NOT NULL,
`date` date NOT NULL,
`time` time NOT NULL,
`Patient_ID` int(45) NOT NULL,
`Doctor_ID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `appointment`
--
INSERT INTO `appointment` (`appointment_ID`, `name`, `email`, `doctor`, `date`, `time`, `Patient_ID`, `Doctor_ID`) VALUES
(8, 'praveen', '[email protected]', 'mahinda', '2023-07-04', '19:08:00', 0, NULL),
(9, 'sadeepa', '[email protected]', 'kusal', '2023-06-13', '18:10:00', 0, NULL),
(10, 'madusha', '[email protected]', 'gota', '2023-06-23', '01:34:00', 0, NULL),
(11, 'shini', '[email protected]', 'basil', '2025-06-04', '00:00:00', 0, NULL),
(12, 's', '[email protected]', 'as', '0000-00-00', '00:00:00', 0, NULL),
(13, 'sssss', '[email protected]', '', '0000-00-00', '00:00:00', 0, NULL),
(14, '', '', '', '0000-00-00', '00:00:00', 0, NULL),
(15, '', '', '', '0000-00-00', '00:00:00', 0, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `bill`
--
CREATE TABLE `bill` (
`Bill_ID` int(11) NOT NULL,
`Date` date DEFAULT NULL,
`Amount` decimal(10,2) DEFAULT NULL,
`Appointment_ID` int(11) DEFAULT NULL,
`Patient_ID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `bill`
--
INSERT INTO `bill` (`Bill_ID`, `Date`, `Amount`, `Appointment_ID`, `Patient_ID`) VALUES
(1, '2023-05-28', 100.00, 1, 1),
(2, '2023-05-29', 150.00, 2, 2),
(3, '2023-05-30', 200.00, 3, 3),
(4, '2023-05-31', 250.00, 4, 4),
(5, '2023-06-01', 300.00, 5, 5);
-- --------------------------------------------------------
--
-- Table structure for table `contact`
--
CREATE TABLE `contact` (
`id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`message` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `contact`
--
INSERT INTO `contact` (`id`, `name`, `email`, `message`) VALUES
(1, 'yohan', '[email protected]', '123'),
(2, 'yohan', '[email protected]', '12'),
(3, 'e.dileepa praveen', '[email protected]', 'hi'),
(4, 'e.dileepa praveen', '[email protected]', 'hi');
-- --------------------------------------------------------
--
-- Table structure for table `delivery_manager`
--
CREATE TABLE `delivery_manager` (
`Delivery_Manager_ID` int(11) NOT NULL,
`User_Name` varchar(50) NOT NULL,
`Password` varchar(50) DEFAULT NULL,
`First_Name` varchar(50) DEFAULT NULL,
`Last_Name` varchar(50) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `delivery_manager`
--
INSERT INTO `delivery_manager` (`Delivery_Manager_ID`, `User_Name`, `Password`, `First_Name`, `Last_Name`, `Email`) VALUES
(1, 'dm123', 'dm123', 'Adam', 'Johnson', '[email protected]'),
(2, 'dm456', 'dm456', 'Sophie', 'Smith', '[email protected]'),
(3, 'dm789', 'dm789', 'Matthew', 'Wilson', '[email protected]'),
(4, 'dm987', 'dm987', 'Olivia', 'Davis', '[email protected]'),
(5, 'dm654', 'dm654', 'Lucas', 'Brown', '[email protected]');
-- --------------------------------------------------------
--
-- Table structure for table `doctor`
--
CREATE TABLE `doctor` (
`Doctor_ID` int(11) NOT NULL,
`First_Name` varchar(50) DEFAULT NULL,
`Last_Name` varchar(50) DEFAULT NULL,
`Specialization` varchar(50) DEFAULT NULL,
`User_Name` varchar(50) DEFAULT NULL,
`Password` varchar(50) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `doctor`
--
INSERT INTO `doctor` (`Doctor_ID`, `First_Name`, `Last_Name`, `Specialization`, `User_Name`, `Password`, `Email`) VALUES
(1, 'Dr. Mark', 'Anderson', 'Cardiology', 'drmark', 'doctor123', '[email protected]'),
(2, 'Dr. Lisa', 'Wilson', 'Dermatology', 'drlisa', 'doctor456', '[email protected]'),
(3, 'Dr. Madawa', 'Taylor', 'Orthopedics', 'drmadawa', 'doctor789', '[email protected]'),
(4, 'Dr. Lahiru', 'Miller', 'Pediatrics', 'drlahiru', 'doctor987', '[email protected]');
-- --------------------------------------------------------
--
-- Table structure for table `medicine_parsel`
--
CREATE TABLE `medicine_parsel` (
`Parsel_ID` int(11) NOT NULL,
`Tracking_No` varchar(50) DEFAULT NULL,
`Destination` varchar(100) DEFAULT NULL,
`Pharmacy_ID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `medicine_parsel`
--
INSERT INTO `medicine_parsel` (`Parsel_ID`, `Tracking_No`, `Destination`, `Pharmacy_ID`) VALUES
(1, 'TRACK123', 'City A', 1),
(2, 'TRACK456', 'City B', 2),
(3, 'TRACK789', 'City C', 3),
(4, 'TRACK987', 'City D', 4),
(5, 'TRACK654', 'City E', 5);
-- --------------------------------------------------------
--
-- Table structure for table `patient`
--
CREATE TABLE `patient` (
`Patient_ID` int(11) NOT NULL,
`Firstname` varchar(50) DEFAULT NULL,
`Lastname` varchar(50) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL,
`Mobile_No` int(15) NOT NULL,
`Nic_No` varchar(15) DEFAULT NULL,
`User_Name` varchar(255) NOT NULL,
`Password` varchar(100) DEFAULT NULL,
`Address` varchar(100) NOT NULL,
`Admin_ID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `patient`
--
INSERT INTO `patient` (`Patient_ID`, `Firstname`, `Lastname`, `Email`, `Mobile_No`, `Nic_No`, `User_Name`, `Password`, `Address`, `Admin_ID`) VALUES
(2, 'gd', 'fsdf', '[email protected]', 2147483647, '454449898', 'medical', '1234', '2nd Street', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `payment`
--
CREATE TABLE `payment` (
`card_name` varchar(255) NOT NULL,
`card_number` varchar(255) NOT NULL,
`card_expire_date` datetime(6) NOT NULL,
`cvc_NUMBER` int(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `pharmacy`
--
CREATE TABLE `pharmacy` (
`Pharmacy_ID` int(11) NOT NULL,
`Name` varchar(100) DEFAULT NULL,
`Address` varchar(100) DEFAULT NULL,
`Manager_ID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `pharmacy`
--
INSERT INTO `pharmacy` (`Pharmacy_ID`, `Name`, `Address`, `Manager_ID`) VALUES
(1, 'ABC Pharmacy', '123 Main St', 1),
(2, 'XYZ Pharmacy', '456 Elm St', 2),
(3, '1234 Pharmacy', '789 Oak St', 3),
(4, '5678 Pharmacy', '321 Pine St', 4),
(5, 'MNO Pharmacy', '654 Maple St', 5);
-- --------------------------------------------------------
--
-- Table structure for table `pharmacy_manager`
--
CREATE TABLE `pharmacy_manager` (
`Manager_ID` int(11) NOT NULL,
`User_Name` varchar(50) NOT NULL,
`First_Name` varchar(50) DEFAULT NULL,
`Address` varchar(100) DEFAULT NULL,
`password` varchar(100) NOT NULL,
`Contact_Number` varchar(20) DEFAULT NULL,
`Email` varchar(100) DEFAULT NULL,
`Joining_Date` date DEFAULT NULL,
`Order_ID` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `pharmacy_manager`
--
INSERT INTO `pharmacy_manager` (`Manager_ID`, `User_Name`, `First_Name`, `Address`, `password`, `Contact_Number`, `Email`, `Joining_Date`, `Order_ID`) VALUES
(1, 'Praveen123', 'Praveen', '123 Main St', 'dp1234', '0765432109', '[email protected]', '2023-01-01', 1),
(2, 'sammani123', 'sammani', '456 Elm St', 'dp1234', '0776543210', '[email protected]', '2023-02-01', 2),
(3, 'kaveen123', 'kaveen', '789 Oak St', 'dp1234', '0787654321', '[email protected]', '2023-03-01', 3),
(4, 'sasindu123', 'sasindu', '321 Pine St', 'dp1234', '0798765432', '[email protected]', '2023-04-01', 4),
(5, 'Vihara123', 'Vihara', '654 Maple St', 'dp1234', '0719876543', '[email protected]', '2023-05-01', 5);
-- --------------------------------------------------------
--
-- Table structure for table `riders`
--
CREATE TABLE `riders` (
`Rider_ID` int(11) NOT NULL,
`First_Name` varchar(50) DEFAULT NULL,
`Last_Name` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `riders`
--
INSERT INTO `riders` (`Rider_ID`, `First_Name`, `Last_Name`) VALUES
(1, 'Silva', 'De'),
(2, 'Praveen', 'Silva'),
(3, 'Dileepa', 'Davis'),
(4, 'Naveen', 'Wilson'),
(5, 'Sandeepa', 'Namal');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(50) NOT NULL,
`address` varchar(255) NOT NULL,
`mobile_number` varchar(255) NOT NULL,
`message` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `address`, `mobile_number`, `message`) VALUES
(1, 'dileepa pravee', '[email protected]', '2nd Street', '0773992948', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`Admin_ID`);
--
-- Indexes for table `appointment`
--
ALTER TABLE `appointment`
ADD PRIMARY KEY (`appointment_ID`),
ADD KEY `FK_Patient_ID` (`Patient_ID`) USING BTREE,
ADD KEY `Doctor_ID` (`Doctor_ID`);
--
-- Indexes for table `bill`
--
ALTER TABLE `bill`
ADD PRIMARY KEY (`Bill_ID`),
ADD KEY `FK_Bill_AppointmentID` (`Appointment_ID`),
ADD KEY `FK_Bill_PatientID` (`Patient_ID`);
--
-- Indexes for table `contact`
--
ALTER TABLE `contact`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `delivery_manager`
--
ALTER TABLE `delivery_manager`
ADD PRIMARY KEY (`Delivery_Manager_ID`);
--
-- Indexes for table `doctor`
--
ALTER TABLE `doctor`
ADD PRIMARY KEY (`Doctor_ID`);
--
-- Indexes for table `medicine_parsel`
--
ALTER TABLE `medicine_parsel`
ADD PRIMARY KEY (`Parsel_ID`),
ADD KEY `FK_Medicine_parsel_PharmacyID` (`Pharmacy_ID`);
--
-- Indexes for table `patient`
--
ALTER TABLE `patient`
ADD PRIMARY KEY (`Patient_ID`),
ADD KEY `FK_Patient_AdminID` (`Admin_ID`);
--
-- Indexes for table `payment`
--
ALTER TABLE `payment`
ADD PRIMARY KEY (`card_number`);
--
-- Indexes for table `pharmacy`
--
ALTER TABLE `pharmacy`
ADD PRIMARY KEY (`Pharmacy_ID`),
ADD KEY `FK_Pharmacy_ManagerID` (`Manager_ID`);
--
-- Indexes for table `pharmacy_manager`
--
ALTER TABLE `pharmacy_manager`
ADD PRIMARY KEY (`Manager_ID`),
ADD KEY `FK_Pharmacy_Manager_OrderID` (`Order_ID`);
--
-- Indexes for table `riders`
--
ALTER TABLE `riders`
ADD PRIMARY KEY (`Rider_ID`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `Admin_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `appointment`
--
ALTER TABLE `appointment`
MODIFY `appointment_ID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `bill`
--
ALTER TABLE `bill`
MODIFY `Bill_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `contact`
--
ALTER TABLE `contact`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `delivery_manager`
--
ALTER TABLE `delivery_manager`
MODIFY `Delivery_Manager_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `doctor`
--
ALTER TABLE `doctor`
MODIFY `Doctor_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `medicine_parsel`
--
ALTER TABLE `medicine_parsel`
MODIFY `Parsel_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `patient`
--
ALTER TABLE `patient`
MODIFY `Patient_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `pharmacy`
--
ALTER TABLE `pharmacy`
MODIFY `Pharmacy_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `pharmacy_manager`
--
ALTER TABLE `pharmacy_manager`
MODIFY `Manager_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `riders`
--
ALTER TABLE `riders`
MODIFY `Rider_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;