
1
select *
from insegnante
where città='Milano'
order by cognome, nome asc
2
select cognome, nome, stipendio*1.1 as stipendiodollari
from insegnante
order by cognome desc, nome desc
3
select cognome, nome, stipendio
from insegnante
where (città='Milano'or Città='Verona') and stipendio Between 100 and 2000
4
select sum(stipendio)
from insegnante
where stipendio > 2000
5
select count(*)
from insegnante
where stipendio<2000
6
select distinct count(Città)
from insegnante
7
Select max(stipendio)
from insegnante
where nome like 'M_r%'
8
Select avg(stipendio)
from insegnante
where città='Milano'or città='como'
9
select MatricolaStudente, count(*) avg(voto)
where esame
group by MatricolaStudente
10
select MatricolaStudente, count(*), avg(voto)
from esame
group by MatricolaStudente
having avg(voto)>25
11
select codicecorso, matricolastudente, voto
from esame join studente on matricolastudente=matricola
where città='Milano'
12
select matricola, cognome, nome
from esame join studente on matricolastudente=matricola join corso on codicecorso=codice and città='Milano'
group by matricola, cognome, nome
having sum(numerocrediti)>=20
1
select matricolaStudente
from esame
where voto=30
INTERSECT
select matricolaStudente
from esame
where voto=33
2
select cognome, nome
from insegnante
UNION
select cognome, nome
from studente
3
select cognome
from insegnante
EXCEPT
select cognome
from studente
where città='Milano'
4
select codice, nome
from corso
where NumeroCreidti>= ALL (Select NumeroCrediti From Corso)
5
select codice, nome
from corso
where NumeroCrediti> ANY (Select NumeroCrediti From Corso)
6
select matricola, nome, cognome
from esame join studente on matricola=matricolastudente
where voto =30 and matricolastudente not in (select matricolastudente from esame where voto<24)
7
select *
from esame as e right join studente as s on e.matricolastudente=s.matricola
9
select matricolastudente
from esame
where voto=30
group by matricolastudente
having count(*) > (select count(*) from esame as e2 where e.matricolastudente=