-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsql.txt
35 lines (32 loc) · 891 Bytes
/
sql.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
-- Create employees table
CREATE TABLE employees (
ID VARCHAR(255) PRIMARY KEY,
name MEDIUMTEXT
);
-- Create projects table
CREATE TABLE projects (
ID INT PRIMARY KEY,
name MEDIUMTEXT
);
-- Create tasks table
CREATE TABLE tasks (
ID INT PRIMARY KEY,
name MEDIUMTEXT
);
-- Create registrations table
CREATE TABLE registrations (
ID INT PRIMARY KEY,
taskID INT,
projectID INT,
employeeID VARCHAR(255),
monthAndYear VARCHAR(255), -- Now a string
month VARCHAR(255), -- Now a string
totalHoursAsNumber DOUBLE,
employeeCost DOUBLE,
generalCost DOUBLE,
overwriteTimeCardProject VARCHAR(255),
overwriteTimeCardTask VARCHAR(255),
FOREIGN KEY (taskID) REFERENCES tasks(ID),
FOREIGN KEY (projectID) REFERENCES projects(ID),
FOREIGN KEY (employeeID) REFERENCES employees(ID)
);