forked from gnyers/python-tuesday
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimesheet-dump.sql
More file actions
40 lines (40 loc) · 1.67 KB
/
timesheet-dump.sql
File metadata and controls
40 lines (40 loc) · 1.67 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
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE users (
id integer PRIMARY KEY AUTOINCREMENT,
fname varchar(40),
sname varchar(60),
email varchar(255)
);
INSERT INTO users VALUES(1,'John','Doe','jdoe@example.com');
INSERT INTO users VALUES(2,'Jane','Brown','jane.brown@example.com');
INSERT INTO users VALUES(3,'Frank','Green','frankg@example.com');
INSERT INTO users VALUES(4,'Eileen','Smith','eileeng@example.com');
INSERT INTO users VALUES(5,'George','Moss','moss@example.com');
CREATE TABLE projects (
id integer PRIMARY KEY AUTOINCREMENT,
name varchar(140)
);
INSERT INTO projects VALUES(1,'Project Roadrunner @ACMECo');
INSERT INTO projects VALUES(2,'Webshop Implementation @ACMECo');
INSERT INTO projects VALUES(3,'Security Audit @ACMECo');
CREATE TABLE bookings (
id integer PRIMARY KEY AUTOINCREMENT,
user integer,
project integer,
date datetime,
hours numerical,
remarks varchar,
FOREIGN KEY (user) REFERENCES users (id),
FOREIGN KEY (project) REFERENCES users (id)
);
INSERT INTO bookings VALUES(1,4,2,'2019-09-02',8,'Landingpage design');
INSERT INTO bookings VALUES(2,4,2,'2019-09-03',6,'Landingpage design');
INSERT INTO bookings VALUES(3,4,1,'2019-09-03',2,'Requirement analysis');
INSERT INTO bookings VALUES(4,4,4,'2019-09-04',8,'Verify inventory');
INSERT INTO bookings VALUES(5,4,1,'2019-09-05',2,'Planning review');
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('users',5);
INSERT INTO sqlite_sequence VALUES('projects',3);
INSERT INTO sqlite_sequence VALUES('bookings',5);
COMMIT;