· 4 years ago · May 08, 2021, 07:42 PM
1-- phpMyAdmin SQL Dump
2-- version 4.9.3
3-- https://www.phpmyadmin.net/
4--
5-- Host: localhost:8889
6-- Generation Time: May 08, 2021 at 10:35 PM
7-- Server version: 5.7.26
8-- PHP Version: 7.4.2
9
10SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
11SET time_zone = "+00:00";
12
13--
14-- Database: `mysitedb`
15--
16CREATE DATABASE IF NOT EXISTS `mysitedb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
17USE `mysitedb`;
18
19-- --------------------------------------------------------
20
21--
22-- Table structure for table `comments`
23--
24
25CREATE TABLE `comments` (
26 `id` int(11) NOT NULL,
27 `created` date NOT NULL,
28 `author` varchar(20) NOT NULL,
29 `comment` varchar(256) NOT NULL,
30 `art_id` int(11) NOT NULL
31) ENGINE=InnoDB DEFAULT CHARSET=utf8;
32
33--
34-- Dumping data for table `comments`
35--
36
37INSERT INTO `comments` (`id`, `created`, `author`, `comment`, `art_id`) VALUES
38(2, '2020-10-21', 'fgdfg', 'dfgfd', 2),
39(3, '2020-10-21', '555', '555', 4),
40(5, '2020-10-29', 'hgjhg', 'jhgj', 3),
41(7, '2020-10-29', 'gfhfgh', 'gfh', 5);
42
43-- --------------------------------------------------------
44
45--
46-- Table structure for table `notes`
47--
48
49CREATE TABLE `notes` (
50 `id` int(11) NOT NULL,
51 `created` date DEFAULT NULL,
52 `title` varchar(20) DEFAULT NULL,
53 `article` varchar(255) DEFAULT NULL
54) ENGINE=InnoDB DEFAULT CHARSET=utf8;
55
56--
57-- Dumping data for table `notes`
58--
59
60INSERT INTO `notes` (`id`, `created`, `title`, `article`) VALUES
61(2, '2020-10-21', '', ''),
62(3, '2020-10-21', '', ''),
63(4, '2020-10-21', '4444', '4444'),
64(5, '2020-10-29', '', '');
65
66-- --------------------------------------------------------
67
68--
69-- Table structure for table `privileges`
70--
71
72CREATE TABLE `privileges` (
73 `id` int(11) NOT NULL,
74 `username` varchar(255) NOT NULL,
75 `password` varchar(255) NOT NULL,
76 `group` int(11) NOT NULL DEFAULT '0'
77) ENGINE=InnoDB DEFAULT CHARSET=utf8;
78
79--
80-- Dumping data for table `privileges`
81--
82
83INSERT INTO `privileges` (`id`, `username`, `password`, `group`) VALUES
84(5, 'alexx876', '0aca988c4ed2cb55f9b48b186eff895a', 1),
85(8, 'user', 'ee11cbb19052e40b07aac0ca060c23ee', 0);
86
87--
88-- Indexes for dumped tables
89--
90
91--
92-- Indexes for table `comments`
93--
94ALTER TABLE `comments`
95 ADD PRIMARY KEY (`id`),
96 ADD KEY `art_id` (`art_id`);
97
98--
99-- Indexes for table `notes`
100--
101ALTER TABLE `notes`
102 ADD PRIMARY KEY (`id`);
103
104--
105-- Indexes for table `privileges`
106--
107ALTER TABLE `privileges`
108 ADD PRIMARY KEY (`id`);
109
110--
111-- AUTO_INCREMENT for dumped tables
112--
113
114--
115-- AUTO_INCREMENT for table `comments`
116--
117ALTER TABLE `comments`
118 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
119
120--
121-- AUTO_INCREMENT for table `notes`
122--
123ALTER TABLE `notes`
124 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
125
126--
127-- AUTO_INCREMENT for table `privileges`
128--
129ALTER TABLE `privileges`
130 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
131
132--
133-- Constraints for dumped tables
134--
135
136--
137-- Constraints for table `comments`
138--
139ALTER TABLE `comments`
140 ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`art_id`) REFERENCES `notes` (`id`);
141--
142-- Database: `ta_system`
143--
144CREATE DATABASE IF NOT EXISTS `ta_system` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
145USE `ta_system`;
146
147-- --------------------------------------------------------
148
149--
150-- Table structure for table `accidentInformatiom`
151--
152
153CREATE TABLE `accidentInformatiom` (
154 `id` int(11) NOT NULL,
155 `cardType` int(1) NOT NULL,
156 `uvdNumber` int(6) NOT NULL,
157 `go-rovdNumber` int(6) NOT NULL,
158 `addCardNumber` int(11) NOT NULL,
159 `accidentDate` date NOT NULL,
160 `accidentTime` time NOT NULL,
161 `deadNumber` int(2) NOT NULL,
162 `injuredNumber` int(2) NOT NULL,
163 `roadAccidentCategory` int(1) NOT NULL,
164 `roadAccidentType` int(1) NOT NULL,
165 `totalMaterialDamage` int(7) NOT NULL,
166 `accidentArea` varchar(45) NOT NULL,
167 `locality` varchar(60) NOT NULL,
168 `street` varchar(60) NOT NULL,
169 `houseNumber` int(3) NOT NULL,
170 `blockNumber` int(3) NOT NULL,
171 `intersectedStreet` varchar(60) NOT NULL,
172 `highwayValue` int(1) NOT NULL,
173 `highwayName` varchar(45) NOT NULL,
174 `mileageAndMeters` varchar(15) NOT NULL,
175 `roadBeloning` int(1) NOT NULL,
176 `roadOrganization` varchar(30) NOT NULL,
177 `typeOfCoating` int(1) NOT NULL,
178 `roadwayState` int(2) NOT NULL,
179 `illumination` int(1) NOT NULL,
180 `planAndProfileElements` int(1) NOT NULL,
181 `weatherCondition` int(1) NOT NULL,
182 `trafficLanesNumber` int(1) NOT NULL,
183 `roadWidth` float NOT NULL,
184 `shoulderWidth` float NOT NULL,
185 `roadsideWidth` float NOT NULL,
186 `divingStripWidth` float NOT NULL,
187 `sidewalkWidth` float NOT NULL,
188 `unsatisfactoryRoadConditions` int(2) NOT NULL,
189 `otherRoadElements` int(2) NOT NULL,
190 `schemaFileName` varchar(30) NOT NULL,
191 `employeeID` int(11) NOT NULL
192) ENGINE=InnoDB DEFAULT CHARSET=utf8;
193
194-- --------------------------------------------------------
195
196--
197-- Table structure for table `departments`
198--
199
200CREATE TABLE `departments` (
201 `id` int(11) NOT NULL,
202 `name` varchar(255) NOT NULL
203) ENGINE=InnoDB DEFAULT CHARSET=utf8;
204
205--
206-- Dumping data for table `departments`
207--
208
209INSERT INTO `departments` (`id`, `name`) VALUES
210(1, 'ОГАИ Фрунзенского РУВД');
211
212-- --------------------------------------------------------
213
214--
215-- Table structure for table `employee`
216--
217
218CREATE TABLE `employee` (
219 `id` int(11) NOT NULL,
220 `firstName` varchar(45) NOT NULL,
221 `lastName` varchar(45) NOT NULL,
222 `patronymic` varchar(45) NOT NULL,
223 `login` varchar(45) NOT NULL,
224 `password` varchar(45) NOT NULL,
225 `departmentID` int(11) NOT NULL
226) ENGINE=InnoDB DEFAULT CHARSET=utf8;
227
228--
229-- Dumping data for table `employee`
230--
231
232INSERT INTO `employee` (`id`, `firstName`, `lastName`, `patronymic`, `login`, `password`, `departmentID`) VALUES
233(1, 'Петров', 'Владимир', 'Андреевич', 'petrov.v', '3e66f7aaad4294225b5d14e513278d3a', 1);
234
235-- --------------------------------------------------------
236
237--
238-- Table structure for table `participantsGeneralInformation`
239--
240
241CREATE TABLE `participantsGeneralInformation` (
242 `id` int(11) NOT NULL,
243 `vehicleSerialNumber` int(2) NOT NULL,
244 `movementMemberNumber` int(2) NOT NULL,
245 `memberCategory` int(1) NOT NULL,
246 `beloningToVehicle` int(2) NOT NULL,
247 `memberStatus` varchar(5) NOT NULL,
248 `dateDeath` date NOT NULL,
249 `severityOfInjuries` int(3) NOT NULL,
250 `medicalInstitutiionWhereIsPlaced` varchar(45) NOT NULL,
251 `trafficViolation` int(2) NOT NULL,
252 `beltOrHemlet` int(1) NOT NULL,
253 `measuresTaken` int(1) NOT NULL,
254 `accidentInformatiomID` int(11) NOT NULL
255) ENGINE=InnoDB DEFAULT CHARSET=utf8;
256
257-- --------------------------------------------------------
258
259--
260-- Table structure for table `partisipantsPersonalData`
261--
262
263CREATE TABLE `partisipantsPersonalData` (
264 `id` int(11) NOT NULL,
265 `passportNumber` varchar(45) NOT NULL,
266 `firstName` varchar(45) NOT NULL,
267 `lastName` varchar(45) NOT NULL,
268 `patronymic` varchar(45) NOT NULL,
269 `sex` varchar(1) NOT NULL,
270 `birthday` date NOT NULL,
271 `driversLisence` varchar(45) NOT NULL,
272 `lisenceIssueDate` date NOT NULL,
273 `drivingExperience` varchar(10) NOT NULL,
274 `timeBehindTheWheel` varchar(10) NOT NULL,
275 `state` varchar(45) NOT NULL,
276 `area` varchar(60) NOT NULL,
277 `district` varchar(45) NOT NULL,
278 `locality` varchar(60) NOT NULL,
279 `street` varchar(60) NOT NULL,
280 `houseNumber` int(3) NOT NULL,
281 `blockNumber` int(3) NOT NULL,
282 `flatNumber` int(3) NOT NULL,
283 `plaseOfWork` varchar(60) NOT NULL,
284 `participantsGeneralInformationID` int(11) NOT NULL
285) ENGINE=InnoDB DEFAULT CHARSET=utf8;
286
287-- --------------------------------------------------------
288
289--
290-- Table structure for table `vehicleData`
291--
292
293CREATE TABLE `vehicleData` (
294 `id` int(11) NOT NULL,
295 `brandName` varchar(45) NOT NULL,
296 `vehicleType` int(3) NOT NULL,
297 `licensePlate` varchar(45) NOT NULL,
298 `engineNumber` varchar(45) NOT NULL,
299 `bodyNumber` varchar(45) NOT NULL,
300 `state` varchar(45) NOT NULL,
301 `area` varchar(60) NOT NULL,
302 `district` varchar(45) NOT NULL,
303 `locality` varchar(60) NOT NULL,
304 `street` varchar(60) NOT NULL,
305 `houseNumber` int(3) NOT NULL,
306 `blockNumber` int(3) NOT NULL,
307 `flatNumber` int(3) NOT NULL,
308 `nameOfCompanyOrMan` varchar(60) NOT NULL,
309 `driveType` int(1) NOT NULL,
310 `loadType` int(1) NOT NULL,
311 `steeringLocation` varchar(6) NOT NULL,
312 `color` int(2) NOT NULL,
313 `trailerPresence` varchar(12) NOT NULL,
314 `vehicleProblems` int(2) NOT NULL,
315 `participantsGeneralInformationID` int(11) NOT NULL
316) ENGINE=InnoDB DEFAULT CHARSET=utf8;
317
318--
319-- Indexes for dumped tables
320--
321
322--
323-- Indexes for table `accidentInformatiom`
324--
325ALTER TABLE `accidentInformatiom`
326 ADD PRIMARY KEY (`id`),
327 ADD KEY `employeeID` (`employeeID`);
328
329--
330-- Indexes for table `departments`
331--
332ALTER TABLE `departments`
333 ADD PRIMARY KEY (`id`),
334 ADD KEY `id` (`id`);
335
336--
337-- Indexes for table `employee`
338--
339ALTER TABLE `employee`
340 ADD PRIMARY KEY (`id`),
341 ADD KEY `id` (`id`),
342 ADD KEY `departmentID` (`departmentID`);
343
344--
345-- Indexes for table `participantsGeneralInformation`
346--
347ALTER TABLE `participantsGeneralInformation`
348 ADD PRIMARY KEY (`id`),
349 ADD KEY `accidentInformatiomID` (`accidentInformatiomID`);
350
351--
352-- Indexes for table `partisipantsPersonalData`
353--
354ALTER TABLE `partisipantsPersonalData`
355 ADD PRIMARY KEY (`id`),
356 ADD KEY `participantsGeneralInformationID` (`participantsGeneralInformationID`);
357
358--
359-- Indexes for table `vehicleData`
360--
361ALTER TABLE `vehicleData`
362 ADD PRIMARY KEY (`id`),
363 ADD KEY `participantsGeneralInformationID` (`participantsGeneralInformationID`);
364
365--
366-- AUTO_INCREMENT for dumped tables
367--
368
369--
370-- AUTO_INCREMENT for table `accidentInformatiom`
371--
372ALTER TABLE `accidentInformatiom`
373 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
374
375--
376-- AUTO_INCREMENT for table `departments`
377--
378ALTER TABLE `departments`
379 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
380
381--
382-- AUTO_INCREMENT for table `employee`
383--
384ALTER TABLE `employee`
385 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
386
387--
388-- AUTO_INCREMENT for table `participantsGeneralInformation`
389--
390ALTER TABLE `participantsGeneralInformation`
391 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
392
393--
394-- AUTO_INCREMENT for table `partisipantsPersonalData`
395--
396ALTER TABLE `partisipantsPersonalData`
397 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
398
399--
400-- AUTO_INCREMENT for table `vehicleData`
401--
402ALTER TABLE `vehicleData`
403 MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
404
405--
406-- Constraints for dumped tables
407--
408
409--
410-- Constraints for table `accidentInformatiom`
411--
412ALTER TABLE `accidentInformatiom`
413 ADD CONSTRAINT `accidentinformatiom_ibfk_1` FOREIGN KEY (`employeeID`) REFERENCES `employee` (`id`);
414
415--
416-- Constraints for table `employee`
417--
418ALTER TABLE `employee`
419 ADD CONSTRAINT `employee_ibfk_1` FOREIGN KEY (`departmentID`) REFERENCES `departments` (`id`);
420
421--
422-- Constraints for table `partisipantsPersonalData`
423--
424ALTER TABLE `partisipantsPersonalData`
425 ADD CONSTRAINT `partisipantspersonaldata_ibfk_1` FOREIGN KEY (`participantsGeneralInformationID`) REFERENCES `participantsGeneralInformation` (`id`);
426
427--
428-- Constraints for table `vehicleData`
429--
430ALTER TABLE `vehicleData`
431 ADD CONSTRAINT `vehicledata_ibfk_1` FOREIGN KEY (`participantsGeneralInformationID`) REFERENCES `participantsGeneralInformation` (`id`);
432