-
Notifications
You must be signed in to change notification settings - Fork 0
/
tec_apps_db.sql
41 lines (36 loc) · 1.03 KB
/
tec_apps_db.sql
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
use tec_apps_db;
CREATE TABLE matriculas(
id INT AUTO_INCREMENT PRIMARY KEY,
status VARCHAR(100) NOT NULL,
estudante_id INT,
turma_id INT
) ENGINE=INNODB;
CREATE TABLE turmas(
id INT AUTO_INCREMENT PRIMARY KEY,
docente_id INT,
nivel_id INT,
data_inicio DATE,
createdAt DATE,
updatedAt DATE,
matricula_id INT
) ENGINE=INNODB;
CREATE TABLE niveis(
id INT AUTO_INCREMENT PRIMARY KEY,
descr_nivel VARCHAR(100),
nivel_id INT,
createdAt DATE,
updatedAt DATE
) ENGINE=INNODB;
CREATE TABLE pessoas(
id INT AUTO_INCREMENT PRIMARY KEY,
nome VARCHAR(100),
ativo BOOLEAN,
email VARCHAR(50),
role VARCHAR(50),
docente_id INT,
matriculas_id INT,
createdAt DATE,
updatedAt DATE
) ENGINE=INNODB;
INSERT INTO turmas (docente_id, nivel_id, data_inicio, createdAt, updatedAt, matricula_id)
VALUES (1, 1, STR_TO_DATE("10-17-2021", "%m-%d-%Y"), STR_TO_DATE("10-17-2021", "%m-%d-%Y"), STR_TO_DATE("10-17-2021", "%m-%d-%Y"), 1 );