-
Notifications
You must be signed in to change notification settings - Fork 9
/
database.txt
58 lines (51 loc) · 1.21 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
CREATE TABLE FLATS (
flat_id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
address TEXT,
flatsize INTEGER,
persons INTEGER NOT NULL,
);
CREATE TABLE ROOMMATES (
roommate_id INTEGER PRIMARY KEY,
flat_id INTEGER FOREIGN KEY,
name TEXT NOT NULL,
age INTEGER
);
CREATE TABLE SHOPPINGLISTS (
shoppinglist_id INTEGER PRIMARY KEY,
flat_id INTEGER FOREIGN KEY,
price INTEGER NOT NULL,
alreadydone INTEGER(0),
);
CREATE TABLE CLEANINGSCHEDULES (
cleaningschedules_ID INTEGER PRIMARY KEY,
roommate_id INTEGER FOREIGN KEY,
date TEXT NOT NULL
);
CREATE TABLE FINANCEEQUIPMENT (
financeequipment_id INTEGER PRIMARY KEY,
roomate_id INTEGER FOREIGN KEY,
buy_in_total_costs INTEGER
);
CREATE TABLE FINANCEITEM (
financeitem_id INTEGER PRIMARY KEY,
financeequipment_id INTEGER FOREIGN KEY,
name TEXT NOT NULL,
price INTEGER NOT NULL
);
CREATE TABLE FINANCEFLAT (
financeflat_id INTEGER PRIMARY KEY,
flat_id FOREIGN KEY,
roommate_id FOREIGN KEY,
rental_fee INTEGER(0),
smartphone_bill INTEGER(0),
energy_bill INTEGER(0),
internet_bill INTEGER(0),
tv_bill INTEGER(0)
);
CREATE TABLE FINANCEFLATITEM (
financeflatitem_id INTEGER PRIMARY KEY,
financeflat_id INTEGER FOREIGN KEY,
name TEXT NOT NULL,
price INTEGER NOT NULL
);