17

Lezione Sql Join

Embed Size (px)

Citation preview

Page 1: Lezione Sql Join
Page 2: Lezione Sql Join
Page 3: Lezione Sql Join
Page 4: Lezione Sql Join
Page 5: Lezione Sql Join
Page 6: Lezione Sql Join
Page 7: Lezione Sql Join
Page 8: Lezione Sql Join
Page 9: Lezione Sql Join
Page 10: Lezione Sql Join
Page 11: Lezione Sql Join
Page 12: Lezione Sql Join

Select studente.nome, voto.materia, voto.voto, voto.data

from studente, voto

where studente.id=voto.studente_id

order by studente.nome asc

Page 13: Lezione Sql Join

Select abbonato.nome, corso.nome, prenota.dataprenota

from abbonato, corso, prenota

where prenota.abbonato_id=abbonato.id

and prenota.corso_id=corso.id

order by corso.nome asc, abbonato.nome asc

Page 14: Lezione Sql Join

Select studente.nome, avg(voto.voto) as ‘voto medio’

from studente, voto

where studente.id=voto.studente_id

group by studente.nome

Page 15: Lezione Sql Join

Select studente.nome, voto.materia, avg(voto.voto) as ‘voto medio’

from studente, voto

where studente.id=voto.studente_id

group by studente.nome, voto.materia

Page 16: Lezione Sql Join

Select abbonato.nome, corso.nome, prenota.dataprenota

from abbonato, corso, prenota

where prenota.abbonato_id=abbonato.id

and prenota.corso_id=corso.id and corso.nome=“acqua gim”

order by prenota.dataprenota asc

Page 17: Lezione Sql Join

Continua con la programmazione:Ossia con l’inpatto della join nel programmare siti web dinamici