-
Notifications
You must be signed in to change notification settings - Fork 0
/
database.txt
83 lines (77 loc) · 2.24 KB
/
database.txt
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
CREATE TABLE Utilizatori (
UtilizatorID INT AUTO_INCREMENT PRIMARY KEY,
Nume VARCHAR(50),
Prenume VARCHAR(50),
NumeUtilizator VARCHAR(50) UNIQUE,
Email VARCHAR(100),
Telefon VARCHAR(15),
Parola VARCHAR(100)
);
CREATE TABLE ResetareParola (
ResetID INT AUTO_INCREMENT PRIMARY KEY,
Email VARCHAR(50),
Token VARCHAR(255),
Expira DATETIME,
FOREIGN KEY (Email) REFERENCES Utilizatori(Email)
);
CREATE TABLE Soferi (
SoferID INT AUTO_INCREMENT PRIMARY KEY,
Nume VARCHAR(50),
Prenume VARCHAR(50),
DataNasterii DATE,
DataAngajarii DATE,
DataSalariu DATE,
Telefon VARCHAR(15),
Email VARCHAR(100),
DataEmiterePermis DATE,
DataExpirarePermis DATE,
DataInceputConcediu DATE,
DataSfarsitConcediu DATE,
UtilizatorID INT,
FOREIGN KEY (UtilizatorID) REFERENCES Utilizatori(UtilizatorID)
);
CREATE TABLE Documente (
DocumentID INT AUTO_INCREMENT PRIMARY KEY,
NumeDocument VARCHAR(100),
TipDocument VARCHAR(50),
DataIncarcareDocument DATE,
NumeFisier VARCHAR(255),
ContinutDocument MEDIUMBLOB,
UtilizatorID INT,
FOREIGN KEY (UtilizatorID) REFERENCES Utilizatori(UtilizatorID)
);
CREATE TABLE Contracte (
ContractID INT AUTO_INCREMENT PRIMARY KEY,
NumeContract VARCHAR(100),
TipContract VARCHAR(50),
DataInceputContract DATE,
DataSfarsitContract DATE,
NumeFisier VARCHAR(255),
ContinutContract MEDIUMBLOB,
UtilizatorID INT,
FOREIGN KEY (UtilizatorID) REFERENCES Utilizatori(UtilizatorID)
);
CREATE TABLE Vehicule (
VehiculID INT AUTO_INCREMENT PRIMARY KEY,
NumarInmatriculare VARCHAR(20),
MarcaModel VARCHAR(50),
AnFabricatie YEAR,
SoferID INT,
Culoare VARCHAR(30),
TipCombustibil VARCHAR(30),
DataInceputITP DATE,
DataSfarsitITP DATE,
DataInceputAsigurare DATE,
DataSfarsitAsigurare DATE,
UtilizatorID INT,
FOREIGN KEY (SoferID) REFERENCES Soferi(SoferID),
FOREIGN KEY (UtilizatorID) REFERENCES Utilizatori(UtilizatorID)
);
CREATE TABLE Sarcini (
SarcinaID INT AUTO_INCREMENT PRIMARY KEY,
NumeSarcina VARCHAR(100),
DescriereSarcina TEXT,
TermenLimitaSarcina DATE,
UtilizatorID INT,
FOREIGN KEY (UtilizatorID) REFERENCES Utilizatori(UtilizatorID)
);