-
Notifications
You must be signed in to change notification settings - Fork 0
/
SQL-Aluno.sql
33 lines (25 loc) · 700 Bytes
/
SQL-Aluno.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
CREATE DATABASE Escola;
Use Escola;
CREATE TABLE disciplina
(
idDisciplina INT(10) PRIMARY KEY NOT NULL AUTO_INCREMENT,
nomeDisciplina VARCHAR (50) NOT NULL,
horario FLOAT(10) NOT NULL
);
CREATE TABLE Aluno
(
idRA INT(50) PRIMARY KEY NOT NULL AUTO_INCREMENT,
nomeDoAluno VARCHAR(50) NOT NULL,
dataDeNasc VARCHAR(50) NOT NULL,
telefone VARCHAR(50) NOT NULL,
email VARCHAR(50) NOT NULL
);
CREATE TABLE notaDoALuno
(
notaDoAluno FLOAT(40) NOT NULL,
idnota INT(50) PRIMARY KEY NOT NULL AUTO_INCREMENT,
idRA INT,
idDisciplina INT,
FOREIGN KEY (idDisciplina) REFERENCES disciplina(idDisciplina),
FOREIGN KEY (idRA) REFERENCES Aluno(idRA)
);