Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE Studente
- (`Matricola` INT PRIMARY KEY, `Nome` VARCHAR(15), `Cognome` VARCHAR(20), `AnnoIscrizione` INT)
- ;
- CREATE TABLE Insegnamento
- (`Codice` INT PRIMARY KEY, `NomeIns` VARCHAR(15), `Docente` VARCHAR(20))
- ;
- CREATE TABLE Esame
- (`Studente` INT, `Insegnamento` INT, `Data` INT, `Voto` INT,
- PRIMARY KEY(`Studente`,`Insegnamento`,`Data`),
- FOREIGN KEY(`Studente`) REFERENCES Studente(`Matricola`),
- FOREIGN KEY(`Insegnamento`) REFERENCES Insegnamento(`Codice`))
- ;
- INSERT INTO Studente
- (`Matricola`, `Nome`, `Cognome`,`AnnoIscrizione`)
- VALUES
- (1234,'Marco','Cauzzi',1993),
- (1323,'Marco','Cauzzi',1993),
- (1455,'Marco','Cauzzi',1993),
- (1312,'Marco','Cauzzi',1993)
- ;
- INSERT INTO Insegnamento
- (`Codice`, `NomeIns`, `Docente`)
- VALUES
- (123123,'Programma23','Bombi'),
- (123312,'Programma23','Bombi'),
- (123112,'Programma23','Bombi'),
- (544545,'Programma26','Bombi'),
- (123456,'Programma23','Bombi')
- ;
- INSERT INTO Esame
- (`Studente`, `Insegnamento`, `Data`, `Voto`)
- VALUES
- (1323,123123,2013,19),
- (1455,123123,2013,30),
- (1323,123312,2013,15),
- (1455,544545,2013,10),
- (1312,123123,2014,27)
- ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement