-
Notifications
You must be signed in to change notification settings - Fork 0
/
Datenbank.txt
39 lines (33 loc) · 988 Bytes
/
Datenbank.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
Für H2 Datenbank Script
CREATE TABLE semester (
semesterId INT NOT NULL AUTO_INCREMENT,
semesterName varchar(100) NOT NULL,
startDatum DATE NOT NULL,
endDatum DATE NOT NULL,
user_Id INT NOT NULL,
PRIMARY KEY (semesterId),
FOREIGN KEY (user_Id) REFERENCES user(userID)
);
CREATE TABLE user (
userID INT NOT NULL AUTO_INCREMENT,
userName varchar(100) NOT NULL,
passwort varchar(100) NOT NULL,
email varchar(100) NOT NULL,
hochschule varchar(100) NOT NULL,
PRIMARY KEY (userID)
);
CREATE TABLE vorlesung (
vorlesungId INT NOT NULL AUTO_INCREMENT,
vorlesungName varchar(100) NOT NULL,
aufwand DOUBLE NOT NULL,
geplanterAufwand DOUBLE NOT NULL,
angestrebteNote DOUBLE NOT NULL,
endNote DOUBLE NULL,
lernzeit DOUBLE NULL,
creditPoints INT NOT NULL,
semesterId INT NOT NULL,
userID INT NOT NULL,
PRIMARY KEY (vorlesungId),
FOREIGN KEY (semesterId) REFERENCES semester(semesterId),
FOREIGN KEY (userId) REFERENCES user(userID)
);