-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreateDB.txt
More file actions
37 lines (33 loc) · 723 Bytes
/
CreateDB.txt
File metadata and controls
37 lines (33 loc) · 723 Bytes
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
CREATE DATABASE HN_service;
USE HN_service;
CREATE TABLE Student (
numstud INT,
name varchar(255),
firstname varchar(255),
dateofbirth DATE,
street varchar(255),
postalcod varchar(255),
city varchar(255),
PRIMARY KEY (numstud)
);
CREATE TABLE Matter (
codemat varchar(255),
wording varchar(255),
coef FLOAT,
PRIMARY KEY (codemat)
);
CREATE TABLE Test (
numtest INT,
testdate DATE,
place varchar(255),
codemat varchar(255),
PRIMARY KEY (numtest),
FOREIGN KEY (codemat) REFERENCES Matter(codemat)
);
CREATE TABLE Notation (
numstud INT,
numtest INT,
score FLOAT,
FOREIGN KEY (numstud) REFERENCES Student(numstud),
FOREIGN KEY (numtest) REFERENCES Test(numtest)
);