-1
Out of curiosity I took a report from my second semester of ADS and this course consists in making an SQL script based on 3 tables: ALUNO
, CLASSE
, MATRICULA
.
I made the script according to the statement, but my script does not run, it contains the following error
ORA-00907: Missing right parenthesis
Follows my script down below:
Create Table Aluno(
Nr_Rgm number(8),
Nm_Nome varchar(40),
Nm_Mae varchar(40),
Dt_Nascimento date,
Id_sexo char(1),
CONSTRAINT Rgm_pk PRIMARY KEY (Nr_Rgm)
);
Create Table Classe(
Cd_Classe number(8),
Nr_AnoLetivo number(4),
Nr_Serie number(2),
Sg_Turma varchar(2),
Cd_Escola number(6),
Cd_Grau number(2),
Cd_Periodo number (2),
CONSTRAINT Classe_pk PRIMARY KEY (Cd_Classe)
);
Create Table Matricula(
Nr_Rgm number(8) ,
Dt_Matricula date,
Cd_Classe number(8),
CONSTRAINT fk_Rgm
FOREIGN KEY (Nr_Rgm)
REFERENCES Aluno(Nr_Rgm)
CONSTRAINT fk_Classe
FOREIGN KEY (Cd_Classe)
REFERENCES Aluno(Cd_Classe)
);
I’m using the http://www.sqlfiddle.com to test the script.
thank you very much, it worked
– Wííl TR
@Wílsantos, if you have solved the problem, mark the answer as accepted ;)
– rLinhares