Lezione Esempio Select

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Lezione Esempio Select - Presentation Transcript

    1. Lezione SQL La Select con una tabella associativa in sqlite. Del Prof. Silvano Natalizi 1 dicembre 2008
    2. Esempio registro voti
    3. La mappatura delle entità
      • Insegnante( idInsegnante ,nomeInsegnante)
      • Studente( idStudente ,nomeStudente,
      • annoScolastico,classe)
    4. Tabella di associazione
      • Verifica( idInsegnante , idStudente ,materia,
      • voto, data )
    5. Creazione delle tabelle
      • Create table Insegnante (idInsegnante integer not null,nomeInsegnante text not null,primary key(idInsegnante);
      • Create table Studente(idStudente integer not null, nomeStudente text not null, anno text not null,classe text not null,primary key(idStudente);
    6. Creazione della tabella associativa
      • Create table Verifica(idInsegnante integer not null, idStudente integer not null, data text not null, voto integer not null, materia text not null, primary key(idInsegnante,idStudente,data);
    7. Inserimento di dati campione
      • Insert into Insegnante values (1,’Rossi’);
      • Insert into Insegnante values (2,’Bianchi’);
      • Insert into Insegnante values (3,’Caio’);
      • Insert into Studente values(1,’Qui’,’20072008’, ‘IVAL’);
      • Insert into Studente values(2,’Quo’,’20072008’,‘IVAL’);
      • Insert into Studente values(3,’Qua’,’20072008’,‘IVAL’);
    8. Inserimento di dati nella tabella associativa
      • Insert into Verifica values(1,1,’20071102’,5,’storia’);
      • Insert into Verifica values(1,2,’20071125’,6,’storia’);
      • Insert into Verifica values(2,1,’20071002’,7,’Elettronica’);
      • Insert into Verifica values(2,1,’20071202’,6,’Elettronica’);
      • Insert into Verifica values(2,3,’20071202’,5,’Elettronica’);
      • Insert into Verifica values(2,2,’20071204’,8,’Elettronica’);
    9. La Select
      • Voglio sapere il nome, il voto e la materia degli studenti insufficienti ?
      • Select nomeStudente,voto,materia
      • from Verifica, Studente
      • where Verifica.idStudente=Studente.idStudente
      • and voto < 6;
    10. Quale è il risultato della select ?

    + silvanonatalizisilvanonatalizi, 2 years ago

    custom

    444 views, 0 favs, 2 embeds more stats

    come fare la select tra due tabelle collegate da un more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 444
      • 405 on SlideShare
      • 39 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 7
    Most viewed embeds
    • 38 views on http://didatticasilvanonatalizi.blogspot.com
    • 1 views on http://www.didatticasilvanonatalizi.blogspot.com

    more

    All embeds
    • 38 views on http://didatticasilvanonatalizi.blogspot.com
    • 1 views on http://www.didatticasilvanonatalizi.blogspot.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories