Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- create view votatoTrumpUltimeElezioni as (
- select v.persona
- from Voto v
- where annoElezione = 2016 and nomeCanditato = "Trump"
- );
- create view votatoRepubblicano as (
- select v.persona
- from Voto v, Candidato c
- where v.nomeCanditato = c.nomeCanditato and c.partitoCandidato = "Repubblicano" and v.annoElezione < 2016
- );
- select avg(Today() - p.dataNascita), avg(p.reddito)
- from Persona p
- where p.cod in (select * from votatoTrumpUltimeElezioni)
- and not in (select * from votatoRepubblicano)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement