lunedì 19 gennaio 2009

compito informatica

Esercizi:

1)

select studente.nome,materia.nome,voto.voto from studente, materia, voto where studente.idStudente=voto.idStudente and materia.idMateria=voto.idMateria order by studente.nome asc;


 2)

select studente.nome,materia.nome,modulo.nome, voto.voto from studente,materia ,modulo, voto where studente.idStudente=voto.idStudente and materia.idMateria =voto.idMateria and materia.idMateria=modulo.idMateria and studente.nome='Paperino';


3)

select materia.nome, studente.nome, voto.voto from studente, materia, voto where studente.idStudente=voto.idStudente and materia.idMateria=voto.idMateria  and studente.nome='Paperino' and voto.idStudente<’6’ group by voto.idStudente;

4)

select idMateria, voto from voto where idMateria=1 group by idMateria;


5)

select idStudente, idMateria, count (voto) from voto where idMateria=’1’ group by idStudente;

6)

select studente .nome, count(voto) as 'numero voti' from voto, studente where studente.idStudente=voto.idStudente and voto.idStudente<6>

7)

select studente.nome, avg(voto) as 'media voti' from voto, studente where studente.idStudente=voto.idStudente group by voto.idStudente;

8)

select docente.nome, materia.nome, modulo.nome, programmazione.mmaaInizio, programmazione.mmaaFine from docente, materia, modulo, programmazione where materia.idMateria=modulo.idMateria and docente.idDocente=programmazione.idMateria and modulo.idModulo=programmazione.idModulo;