.dsy:it.
Show 150 posts per page

.dsy:it. (http://www.dsy.it/forum/)
- Basi di dati ~ comunicazione digitale (http://www.dsy.it/forum/forumdisplay.php?forumid=108)
-- domanda esercizio sql (http://www.dsy.it/forum/showthread.php?threadid=35640)


Posted by black.jack on 01-07-2008 15:01:

domanda esercizio sql

Pizza(codP, nome,prezzo)
Cliente(telC,cognomeC,nomeC,via,nCiv,nInt)
Ordine(telCCliente,data,codPPizza,qta,importo)


Modificare tutti gli ordini dei clienti che abitano in via dei Girasoli riducendo del 10%
l'importo da pagare per una pizza ad eccezione degli ordini che riguardano le pizze
margherita e vegetariana.

SOLUZIONE DEL PROF:

UPDATE Ordine
SET importo = 0.9 * importo
WHERE telC IN (SELECT telC FROM Cliente WHERE via = ʹvia dei Girasoli&; )
AND codP NOT IN (SELECT codP FROM Pizza
WHERE nome IN (ʹmargheritaʹ,ʹvegetarianaʹ ));

DOMANDA:

alla fine, anzichè mettere

WHERE nome IN (ʹmargheritaʹ,ʹvegetarianaʹ ));

si poteva usare WHERE nome=margherita OR nome=vegetariana ?


Posted by el-mundo on 01-07-2008 16:56:

si.
se guardi sulle slide c'è scritto.


Posted by black.jack on 01-07-2008 18:27:

l'ho trovato..grazie! ;)


All times are GMT. The time now is 16:39.
Show all 3 posts from this thread on one page

Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.