-
Notifications
You must be signed in to change notification settings - Fork 0
/
project_dbm.sql
244 lines (194 loc) · 6.68 KB
/
project_dbm.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
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 01, 2020 at 09:34 PM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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: `project_dbm`
--
-- --------------------------------------------------------
--
-- Table structure for table `appointment`
--
DROP TABLE IF EXISTS `appointment`;
CREATE TABLE IF NOT EXISTS `appointment` (
`dateAndTime` datetime NOT NULL,
`description` text NOT NULL,
`pSSN` int(9) NOT NULL,
`SSN` int(9) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `appointment`
--
INSERT INTO `appointment` (`dateAndTime`, `description`, `pSSN`, `SSN`) VALUES
('2020-06-03 10:20:00', '', 1, 2),
('2020-06-05 08:00:00', '', 2, 4),
('2020-06-17 10:00:00', 'Having head pain. (forhead)', 3, 2),
('2020-06-15 09:30:00', 'Broken leg', 1, 4);
-- --------------------------------------------------------
--
-- Table structure for table `cleaner`
--
DROP TABLE IF EXISTS `cleaner`;
CREATE TABLE IF NOT EXISTS `cleaner` (
`salary` int(4) NOT NULL,
`SSN` int(9) NOT NULL,
PRIMARY KEY (`SSN`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `cleaner`
--
INSERT INTO `cleaner` (`salary`, `SSN`) VALUES
(1400, 3),
(1450, 6);
-- --------------------------------------------------------
--
-- Table structure for table `department`
--
DROP TABLE IF EXISTS `department`;
CREATE TABLE IF NOT EXISTS `department` (
`dID` int(9) NOT NULL AUTO_INCREMENT,
`name` varchar(25) NOT NULL,
PRIMARY KEY (`dID`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `department`
--
INSERT INTO `department` (`dID`, `name`) VALUES
(1, 'New York, Manhattan'),
(2, 'Sarajevo'),
(3, 'Vancouver');
-- --------------------------------------------------------
--
-- Table structure for table `doctor`
--
DROP TABLE IF EXISTS `doctor`;
CREATE TABLE IF NOT EXISTS `doctor` (
`salary` int(4) NOT NULL,
`specialization` varchar(25) NOT NULL,
`SSN` int(11) NOT NULL,
PRIMARY KEY (`SSN`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `doctor`
--
INSERT INTO `doctor` (`salary`, `specialization`, `SSN`) VALUES
(2950, 'Dječija medicina', 2),
(4500, 'Kardio Hirurgija', 4);
-- --------------------------------------------------------
--
-- Table structure for table `employee`
--
DROP TABLE IF EXISTS `employee`;
CREATE TABLE IF NOT EXISTS `employee` (
`SSN` int(9) NOT NULL AUTO_INCREMENT,
`firstN` varchar(20) NOT NULL,
`lastN` varchar(20) NOT NULL,
`firstDay` date NOT NULL,
`phoneN` int(13) NOT NULL,
`sex` enum('Female','Male') NOT NULL,
`bDate` date NOT NULL,
`address` varchar(40) NOT NULL,
`workingHours` int(3) NOT NULL,
`dID` int(11) NOT NULL,
PRIMARY KEY (`SSN`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `employee`
--
INSERT INTO `employee` (`SSN`, `firstN`, `lastN`, `firstDay`, `phoneN`, `sex`, `bDate`, `address`, `workingHours`, `dID`) VALUES
(1, 'Ahmed', 'Krdzalic', '2019-09-11', 61043037, 'Male', '1999-01-07', 'Put I Alićehajića 65 Bukva, Tesanj', 7, 1),
(2, 'Sara', 'Sivic', '2018-10-17', 642263870, 'Female', '2000-01-18', 'Put I Alićehajića 65 Bukva, Tesanj', 7, 2),
(3, 'Sabahudin', 'Osmanovic', '2018-05-19', 62228394, 'Male', '1995-01-02', 'Rasima Kapetanovica 45, Gracanica', 8, 2),
(4, 'Mishary', 'Al Afasi', '2020-01-19', 642553879, 'Male', '1990-07-20', 'Sarajlije Ahme 23, Sarajevo, Ilidza', 7, 1),
(5, 'Hattab', 'Efendic', '2017-02-13', 123129412, 'Male', '1992-10-09', 'Karpandzica 40 Irac, Tuzla', 7, 3),
(6, 'Maryam', 'El Hubbi', '2019-07-09', 123243132, 'Female', '1999-03-23', 'Sarajlije Ahme 21, Sarajevo, Ilidza', 6, 3),
(7, 'Nermina', 'Sarić', '2017-06-24', 768123894, 'Female', '1989-07-07', 'Ćepenci 52, Zenica', 7, 2),
(8, 'Sumejja', 'Kahvić', '2018-06-17', 64268938, 'Female', '1990-06-26', 'Stefan 5, Olovo', 6, 1);
-- --------------------------------------------------------
--
-- Table structure for table `emr`
--
DROP TABLE IF EXISTS `emr`;
CREATE TABLE IF NOT EXISTS `emr` (
`salary` int(4) NOT NULL,
`registration` varchar(12) NOT NULL,
`SSN` int(9) NOT NULL,
PRIMARY KEY (`SSN`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `emr`
--
INSERT INTO `emr` (`salary`, `registration`, `SSN`) VALUES
(2800, 'OK-MMI', 1),
(2600, '130-A-256', 5);
-- --------------------------------------------------------
--
-- Table structure for table `nurse`
--
DROP TABLE IF EXISTS `nurse`;
CREATE TABLE IF NOT EXISTS `nurse` (
`salary` int(4) NOT NULL,
`SSN` int(9) NOT NULL,
PRIMARY KEY (`SSN`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `nurse`
--
INSERT INTO `nurse` (`salary`, `SSN`) VALUES
(2400, 7),
(2555, 8);
-- --------------------------------------------------------
--
-- Table structure for table `patient`
--
DROP TABLE IF EXISTS `patient`;
CREATE TABLE IF NOT EXISTS `patient` (
`pSSN` int(9) NOT NULL AUTO_INCREMENT,
`firstN` varchar(20) NOT NULL,
`lastN` varchar(20) NOT NULL,
`phoneN` int(13) NOT NULL,
`sex` enum('Female','Male') NOT NULL,
`bDate` date NOT NULL,
`address` varchar(40) NOT NULL,
PRIMARY KEY (`pSSN`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
--
-- Dumping data for table `patient`
--
INSERT INTO `patient` (`pSSN`, `firstN`, `lastN`, `phoneN`, `sex`, `bDate`, `address`) VALUES
(1, 'Sabahudin', 'Krdzalic', 321543654, 'Male', '1989-01-07', 'Kepića brdo 21, Umoljani, Sarajevo'),
(2, 'Naim', 'Karahmet', 89321879, 'Male', '1974-10-17', 'Sarajlije Atifa 1, Bosanska Krupa'),
(3, 'Safer', 'Korajić', 789123890, 'Male', '1966-01-07', 'Kvazimod 33, Teslić'),
(4, 'Sumejja', 'Ahmić', 789132890, 'Female', '1954-12-27', 'Kepić Atife 54, Stolac');
-- --------------------------------------------------------
--
-- Table structure for table `vehicle`
--
DROP TABLE IF EXISTS `vehicle`;
CREATE TABLE IF NOT EXISTS `vehicle` (
`registration` varchar(12) NOT NULL,
`name` varchar(40) NOT NULL,
PRIMARY KEY (`registration`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `vehicle`
--
INSERT INTO `vehicle` (`registration`, `name`) VALUES
('130-A-256', 'VW Transporter T7'),
('OK-MMI', 'Eurocopter 120 Colibri (Helicopter)');
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 */;