Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Didattica > Corsi A - F > Basi di dati ~ informatica triennale > Esercizio Sql
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
morte2097
.primate.

User info:
Registered: Sep 2004
Posts: 68 (0.01 al dì)
Location: --------------------------------
Corso: info
Anno: primo
Time Online: 1 Day, 14:12:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Esercizio Sql

Vi prego aiutatemi ho un dubbio questo esercizio è preso dall'appello di aprile 2006

CLIENTE (#Nrtelefono,Nome,Indirizzo)
ORDINE (#Nrtelefono,#CodiceP,# CodiceOP,#data,costo)
PIZZA (#CodiceP,Nome,Prezzo)
# = kiave primaria

A) determinare per ogni operatore e ogni pizza il costo totale degli ordini effettutati;

B) determinare il nome dei clienti che hanno ordinato pizza ad almeno due operatori diversi

ogni aiuto è ben accetto!

04-04-2008 20:38
Click Here to See the Profile for morte2097 Click here to Send morte2097 a Private Message Find more posts by morte2097 Add morte2097 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
CaboM.BNA
.grande:maestro.

User info:
Registered: Jan 2006
Posts: 503 (0.07 al dì)
Location:
Corso:
Anno:
Time Online: 1 Day, 23:32:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

A)

code:
SELECT codice_pizza, codice_operatore, SUM(costo) FROM ordine GROUP BY codice_pizza, codice_operatore;


B)
code:
SELECT nome FROM cliente WHERE nr_telefono IN (SELECT nr_telefono FROM ordine GROUP BY nr_telefono HAVING COUNT (DISTINCT codice_operatore) >= 2 );


N.B. in "B": la subquery mi permette di trovare i numeri di telefono di quei clienti che hanno fatto (almeno 2) ordini a 2 diversi operatori...

04-04-2008 22:29
Click Here to See the Profile for CaboM.BNA Click here to Send CaboM.BNA a Private Message Find more posts by CaboM.BNA Add CaboM.BNA to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 15:03.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.057 seconds (56.94% PHP - 43.06% MySQL) con 26 query.