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 ~ comunicazione digitale > Basi di dati:soluzioni??
Pages (3): [1] 2 3 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
Alis
.grande:maestro.

User info:
Registered: Jun 2002
Posts: 862 (0.10 al dì)
Location: Corsico
Corso:
Anno:
Time Online: 10 Days, 16:32:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Question Basi di dati:soluzioni??

Abbiamo fatto degli esercizi, ma non siamo sicuri dei risultati, ci potete dire se sono giusti?

Grazie!!!!!!!!!!!!!

Esame 13/01/03:

Esercizio 1:
A) SELECT DISTINCT IndirizzoFornitore
FROM Computer, Installazione
WHERE Computer.CodComputer=Installazione.CodComputer
AND descrizioneSoftware="database";

B) SELECT Marca, Modello, COUNT(CodComputer)
FROM Computer
GROUP BY Marca, Modello;

C) SELECT CodFornitore, MAX(COUNT(CodComputer))
FROM Computer
GROUP BY CodFornitore;

Esercizio 3:
CREATE TABLE R1(K Integer not null, A Integer)
PRIMARY KEY (K);
GRANT SELECT ON R1 TO Rossi;

CREATE TABLE R2(K Integer not null, B Integer)
PRIMARY KEY (K);
GRANT SELECT ON R2 TO Rossi;

INSERT INTO R1(K, A)
SELECT K, A
FROM R;

INSERT INTO R2(K, B)
SELECT K, B
FROM R;

DROP TABLE R;

CREATE VIEW R(K, A, B) AS
SELECT K, A, B
FROM R1, R2
WHERE R1.K=R2.K;


Esame 11/6/99:

Esercizio 1:
SELECT MAX(Prezzo), MIN(Prezzo), Nome
FROM Vendite, Auto, Venditori
WHERE Venditori.Vcod=Vendite.Vcod AND Auto.Acod=Vendite.Acod
AND Età <30 AND Marca="Toyota" AND Modello="Carina"
GROUP BY Nome;


Esame 20/6/02:

Esercizio 1:
B) SELECT Autore#, MIN(COUNT(Libro#))
FROM Libri, Prestiti
WHERE Libri.Libro#=Prestiti.Libro#
GRUOP BY Autore#;

C) DELETE FROM Libri
WHERE Argomento-Principale="Teoria degli Algoritmi"
Libro IN (SELECT Libro FROM Prestiti
WHERE Nome-Utente="Rossi");


Esame 2/9/02:

Esercizio 1: A) SELECT DISTINCT IndirizzoFornitore
FROM Computer, Installazione
WHERE Computer.CodComputer=
Installazione.CodComputer AND
dataInstallazione < #1/1/95#;

09-02-2003 20:23
Click Here to See the Profile for Alis Click here to Send Alis a Private Message Find more posts by Alis Add Alis to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.09 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Angry

Dai, qualcuno che risponda!!! :(

Ne mettiamo su un altro, del 20/06/2002, il numero 3:

a)

Tom: GRANT select, insert ON R TO Alice, Sam WITH GRANT OPTION;
Tom: GRANT delete ON R TO Alice;
Sam: GRANT select ON R TO Ann WITH GRANT OPTION;
Ann: GRANT select ON R TO Matt WITH GRANT OPTION;
Alice: GRANT select, insert ON R TO Matt, Ann WITH GRANT OPTION;
Matt: GRANT insert, select ON R TO Helen;
Tom: REVOKE select, insert, delete ON R FROM Alice;

b) Dopo il comando di revoca, Matt, Ann ed Helen possono eseguire solamente operazioni di SELECT.

Per favore, prima di giovedì!!!!!!!! :cry:

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

10-02-2003 11:40
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
mimasuper
.consigliere.

User info:
Registered: Sep 2002
Posts: 146 (0.02 al dì)
Location: vic. Milano
Corso: com.dig.
Anno: III anno
Time Online: 2 Days, 13:24:04: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Riguardo all'esame del 13-01-03 il C dell'esercizio 1 è sbagliato. Ne sono sicura xchè anch'io l'ho fatto così all'esame e me l'ha segnato. Non so sinceramente come si faccia, ma so che non puoi fare MAX(COUNT(CodComputer). Per il resto gli altri mi sembrano giusti, xchè anch'io li ho fatti così. In bocca al lupo!:)

10-02-2003 12:29
Click Here to See the Profile for mimasuper Click here to Send mimasuper a Private Message Find more posts by mimasuper Add mimasuper to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.09 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Grazie, proveremo a rivederlo un attimo!

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

10-02-2003 12:42
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
imation
.illuminato.

User info:
Registered: May 2002
Posts: 158 (0.02 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 2
Time Online: 3 Days, 1:19:31 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by mimasuper
Riguardo all'esame del 13-01-03 il C dell'esercizio 1 è sbagliato. Ne sono sicura xchè anch'io l'ho fatto così all'esame e me l'ha segnato. Non so sinceramente come si faccia, ma so che non puoi fare MAX(COUNT(CodComputer). Per il resto gli altri mi sembrano giusti, xchè anch'io li ho fatti così. In bocca al lupo!:)


anch'io l'avevo pensato così ma ho visto che nn si può fare (lo stesso vale per Esame 20/6/02: Esercizio 1: B) SELECT Autore#, MIN(COUNT(Libro#)))... mi sono scervellato ma nn ho trovato soluzione...

se avete qualche idea mi dareste una mano...

Last edited by imation on 10-02-2003 at 13:37

10-02-2003 13:32
Click Here to See the Profile for imation Click here to Send imation a Private Message Find more posts by imation Add imation to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alis
.grande:maestro.

User info:
Registered: Jun 2002
Posts: 862 (0.10 al dì)
Location: Corsico
Corso:
Anno:
Time Online: 10 Days, 16:32:12 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Grazie mimaaaaaaaaaaaa!!!!!!!!!!!:D

10-02-2003 18:54
Click Here to See the Profile for Alis Click here to Send Alis a Private Message Find more posts by Alis Add Alis to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Lunik
dsy core staff

User info:
Registered: Mar 2002
Posts: 22362 (2.56 al dì)
Location: Milano
Corso: ComDig
Anno: Dott.ssa
Time Online: 93 Days, 0:52:10 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

potete sempre testare le query con mySql...

__________________
Il DSY su Facebook!!!

10-02-2003 18:59
Click Here to See the Profile for Lunik Click Here to See the Blog of Lunik Click here to Send Lunik a Private Message Visit Lunik's homepage! Find more posts by Lunik Add Lunik to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.09 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Con Access mi vanno, ma lei le considera sbagliate!

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

10-02-2003 19:31
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Lunik
dsy core staff

User info:
Registered: Mar 2002
Posts: 22362 (2.56 al dì)
Location: Milano
Corso: ComDig
Anno: Dott.ssa
Time Online: 93 Days, 0:52:10 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Lei chi?
strano..Access.....con non so che pulsantino vedevi il codice SQL...che è un po' da modificare xè non è quello standard...

__________________
Il DSY su Facebook!!!

10-02-2003 19:34
Click Here to See the Profile for Lunik Click Here to See the Blog of Lunik Click here to Send Lunik a Private Message Visit Lunik's homepage! Find more posts by Lunik Add Lunik to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
imation
.illuminato.

User info:
Registered: May 2002
Posts: 158 (0.02 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 2
Time Online: 3 Days, 1:19:31 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

SELECT CodFornitore, COUNT(CodComputer)
FROM Computer
GROUP BY CodFornitore
ORDER BY COUNT(CodComputer) DESC
FETCH FIRST ROW ONLY;

...questo comando dovrebbe prendere solo la prima tupla del risultato, quindi quella con il maggior numero di computer...

11-02-2003 01:08
Click Here to See the Profile for imation Click here to Send imation a Private Message Find more posts by imation Add imation to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.09 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Il problema è che non ho mai visto questo FETCH a lezione, pensa che non ha neanche spiegato TOP n, che permette di scegliere le prime n righe!

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

11-02-2003 07:27
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ripe
- up in the mountains -

User info:
Registered: Jun 2002
Posts: 9469 (1.09 al dì)
Location: Cinisellooo
Corso: TICO TICO
Anno: Primo
Time Online: 61 Days, 2:33:39 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Molto interessante questo link:

Clicca qui per le funzioni di gruppo a due livelli

Leggete soprattutto l'ultima parte in fondo!!!

__________________
«And if you ever smell christian blood up in the mountains, then get your axe and chop them down!»

11-02-2003 07:32
Click Here to See the Profile for ripe Click Here to See the Blog of ripe Click here to Send ripe a Private Message Find more posts by ripe Add ripe to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Lunik
dsy core staff

User info:
Registered: Mar 2002
Posts: 22362 (2.56 al dì)
Location: Milano
Corso: ComDig
Anno: Dott.ssa
Time Online: 93 Days, 0:52:10 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

:D
Qualcuno vuole la traduzione di quel che c'è scritto nel link di Ripe?

:asd:

__________________
Il DSY su Facebook!!!

11-02-2003 09:57
Click Here to See the Profile for Lunik Click Here to See the Blog of Lunik Click here to Send Lunik a Private Message Visit Lunik's homepage! Find more posts by Lunik Add Lunik to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Vale
.illuminato.

User info:
Registered: Jul 2002
Posts: 230 (0.03 al dì)
Location:
Corso:
Anno:
Time Online: 3 Days, 19:48:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

io per il punto (c) del primo esercizio del 13/01 ho fatto così

select distinct c.codFornitore from
computer c,
(select codFornitore, count(*) as b from computer group by codFornitore) t

WHERE
b=(select max(a) from (select count(*) as a from computer group by codfornitore) h)
and c.codfornitore=t.codfornitore

che ne pensate?


X Ripe

l'esercizio del20/06/02 è corretto secondo me puoi essere più preciso dicendo che Matt e Ann hanno diritti di Select con grant option, mentre helen solo select

12-02-2003 13:16
Click Here to See the Profile for Vale Click here to Send Vale a Private Message Find more posts by Vale Add Vale to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
imation
.illuminato.

User info:
Registered: May 2002
Posts: 158 (0.02 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 2
Time Online: 3 Days, 1:19:31 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Vale
WHERE
b=(select max(a) from (select count(*) as a from computer group by codfornitore) h)
and c.codfornitore=t.codfornitore



qui penso ci sia un errore, xchè nn si può impostare condizioni sul count(funzione di gruppo) con il where... dovresti farlo con un having...

12-02-2003 14:52
Click Here to See the Profile for imation Click here to Send imation a Private Message Find more posts by imation Add imation to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 03:49.    Post New Thread    Post A Reply
Pages (3): [1] 2 3 »   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.097 seconds (64.18% PHP - 35.82% MySQL) con 25 query.