-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbasededatos.txt
95 lines (83 loc) · 1.7 KB
/
basededatos.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
CREATE DATABASE final;
CREATE TABLE clave(
ID INT PRIMARY KEY AUTO_INCREMENT,
clave VARCHAR(10) NOT NULL
);
CREATE TABLE seccion(
ID INT PRIMARY KEY AUTO_INCREMENT,
seccion varchar(5) NOT NULL
);
CREATE TABLE credito(
ID INT PRIMARY KEY AUTO_INCREMENT,
cretido VARCHAR(4) NOT NULL
);
CREATE TABLE cupo(
ID INT PRIMARY KEY AUTO_INCREMENT,
cupo VARCHAR(4) NOT NULL
);
CREATE TABLE disponible(
ID INT PRIMARY KEY AUTO_INCREMENT,
disponible VARCHAR(4) NOT NULL
);
CREATE TABLE ses(
ID INT PRIMARY KEY AUTO_INCREMENT,
ses VARCHAR(3) NOT NULL
);
CREATE TABLE hora(
ID INT PRIMARY KEY AUTO_INCREMENT,
hora VARCHAR(20) NOT NULL
);
CREATE TABLE dia(
ID INT PRIMARY KEY AUTO_INCREMENT,
dia VARCHAR(10) NOT NULL
);
CREATE TABLE edificio(
ID INT PRIMARY KEY AUTO_INCREMENT,
edificio VARCHAR(7) NOT NULL
);
CREATE TABLE aula(
ID INT PRIMARY KEY AUTO_INCREMENT,
aula VARCHAR(7) NOT NULL
);
CREATE TABLE periodo(
ID INT PRIMARY KEY AUTO_INCREMENT,
periodo VARCHAR(30) NOT NULL
);
CREATE TABLE registro(
nrc VARCHAR(10),
nombre varchar(60) NOT NULL,
nombre_maestro varchar(60) NOT NULL,
clave INT NOT NULL,
sec INT NOT NULL,
cr INT NOT NULL,
cup INT NOT NULL,
dis INT NOT NULL,
ses INT NOT NULL,
hora INT NOT NULL,
dia INT NOT NULL,
edif INT NOT NULL,
aula INT NOT NULL,
periodo INT NOT NULL,
FOREIGN KEY (clave)
REFERENCES clave(ID),
FOREIGN KEY (sec)
REFERENCES seccion(ID),
FOREIGN KEY (cr)
REFERENCES credito(ID),
FOREIGN KEY (cup)
REFERENCES cupo(ID),
FOREIGN KEY (dis)
REFERENCES disponible(ID),
FOREIGN KEY (ses)
REFERENCES ses(ID),
FOREIGN KEY (hora)
REFERENCES hora(ID),
FOREIGN KEY (dia)
REFERENCES dia(ID),
FOREIGN KEY (edif)
REFERENCES edificio(ID),
FOREIGN KEY (aula)
REFERENCES aula(ID),
FOREIGN KEY (periodo)
REFERENCES periodo(ID)
);