-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdump.sql
More file actions
45 lines (41 loc) · 1.04 KB
/
dump.sql
File metadata and controls
45 lines (41 loc) · 1.04 KB
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
CREATE TABLE employees(
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
lastName VARCHAR(255) NOT NULL,
address TEXT,
phone VARCHAR(10),
note TEXT,
hourlyPayment INT NOT NULL
);
CREATE TABLE clients(
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
lastName VARCHAR(255) NOT NULL,
birthDate DATE NOT NULL
);
CREATE TABLE vehicles(
id INT AUTO_INCREMENT PRIMARY KEY,
brand VARCHAR(255) NOT NULL,
model VARCHAR(255) NOT NULL,
productionYear DATE,
registrationNumber VARCHAR(255),
nextRepairDate DATE,
client_id INT NOT NULL,
FOREIGN KEY (client_id) REFERENCES clients(id)
);
CREATE TABLE orders(
id INT AUTO_INCREMENT PRIMARY KEY,
acceptanceDate DATE,
planningStartDate DATE,
startRepair DATE,
employee_id INT NOT NULL,
problemDescription text,
repairDescription text,
status VARCHAR(255),
vehicle_id INT NOT NULL,
repairCost BIGINT,
partCost BIGINT,
repairHours INT,
FOREIGN KEY (employee_id) REFERENCES employees(id),
FOREIGN KEY (vehicle_id) REFERENCES vehicles(id)
);