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 > esami perlasca 06/07
Pages (8): « First ... « 3 4 5 6 [7] 8 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
carlinus
.precettore.

User info:
Registered: Nov 2004
Posts: 85 (0.01 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3
Time Online: 1 Day, 8:08:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ARIEL
Ah cavolo mi sa che avevo sbagliato a scrivere la sottoquery....così forse potrebbe andare...

SELECT i.Matr
FROM Progetti p, Impiegati i, Assegnamento a
WHERE i.Matr=a.Matr AND p.CodP=a.CodP AND budget>='50000' AND p.Nome='Microsoft'
GROUP BY Matr
HAVING COUNT (CodP)=(SELECT COUNT (CodP) FROM Progetti
WHERE Nome='Microsoft');


pure io l'ho fatta così e penso che sia giusta perchè conta il codP di un impiegato che ha partecipato a progetti microsoft con 500000 di budget se qst è uguale al numero tot di codp dei progetti progetti microsoft con 500000 di budget allora restituisce l'impiegato

21-02-2008 16:36
Click Here to See the Profile for carlinus Click here to Send carlinus a Private Message Find more posts by carlinus Add carlinus to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
LiJay
.illuminato.

User info:
Registered: Mar 2006
Posts: 182 (0.02 al dì)
Location: bergamo
Corso: comunicazione digitale
Anno: 2
Time Online: 3 Days, 11:22:07: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

SELECT DISTINCT impiegati.nome, impiegati.matr, progetti.budget
FROM impiegati, assegnamento, progetti
WHERE impiegati.matr = assegnamento.matr AND progetti.nome = 'microsoft' AND progetti.budget >= 500000
GROUP BY progetti.budget, impiegati.nome, impiegati.matr
HAVING count(impiegati.matr) = ( SELECT count(assegnamento.matr) AS count
FROM assegnamento, progetti
WHERE assegnamento.cod_progetto = progetti.cod_progetti AND progetti.nome = 'microsoft' AND progetti.budget >= 500000)

cosi' sono certa che va,mi sono creata apposta il db per provare le varie query^^

21-02-2008 16:37
Click Here to See the Profile for LiJay Click here to Send LiJay a Private Message Find more posts by LiJay Add LiJay to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ARIEL
.grande:maestro.

User info:
Registered: Jul 2005
Posts: 636 (0.08 al dì)
Location: milano
Corso: Comunicazione digitale
Anno: Dottoressa!!!
Time Online: 12 Days, 7:36:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

:shock::shock::shock: è talmente contorta che non riesco nemmeno a capirla! Sarà anche che sono fusa, è da stamattina che sto facendo query! :cry:

21-02-2008 16:41
Click Here to See the Profile for ARIEL Click here to Send ARIEL a Private Message Find more posts by ARIEL Add ARIEL to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ARIEL
.grande:maestro.

User info:
Registered: Jul 2005
Posts: 636 (0.08 al dì)
Location: milano
Corso: Comunicazione digitale
Anno: Dottoressa!!!
Time Online: 12 Days, 7:36:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

cmq come avete fatto la query:

Determinare gli impiegati che non sono stati assegnati ad alcun progetto?

@Lijay: se per caso hai tempo puoi provare anche la query:
SELECT i.Matr
FROM Progetti p, Impiegati i, Assegnamento a
WHERE i.Matr=a.Matr AND p.CodP=a.CodP AND budget>='50000' AND p.Nome='Microsoft'
GROUP BY Matr
HAVING COUNT (CodP)=(SELECT COUNT (CodP) FROM Progetti
WHERE Nome='Microsoft');


Tanto per avere la certezza che funziona! Grazie

21-02-2008 16:44
Click Here to See the Profile for ARIEL Click here to Send ARIEL a Private Message Find more posts by ARIEL Add ARIEL to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
zyx
.consigliere.

User info:
Registered: Nov 2005
Posts: 127 (0.02 al dì)
Location: Ceriano Laghetto
Corso: comunicazione digitale
Anno: 2° anno
Time Online: 1 Day, 14:12:42 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ma a che ora è domani l'esame e dove si trova???

21-02-2008 16:52
Click Here to See the Profile for zyx Click here to Send zyx a Private Message Find more posts by zyx Add zyx to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ARIEL
.grande:maestro.

User info:
Registered: Jul 2005
Posts: 636 (0.08 al dì)
Location: milano
Corso: Comunicazione digitale
Anno: Dottoressa!!!
Time Online: 12 Days, 7:36:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

L'esame di Gestione dell'Informazione si terrà il 22 Febbraio alle ore 14.00 in aula Beta, via Comelico

21-02-2008 16:53
Click Here to See the Profile for ARIEL Click here to Send ARIEL a Private Message Find more posts by ARIEL Add ARIEL to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
tolarian
Il Mezzorco Druido

User info:
Registered: Oct 2004
Posts: 144 (0.02 al dì)
Location: Biella
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 13:36:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ARIEL
cmq come avete fatto la query:

Determinare gli impiegati che non sono stati assegnati ad alcun progetto?

@Lijay: se per caso hai tempo puoi provare anche la query:
SELECT i.Matr
FROM Progetti p, Impiegati i, Assegnamento a
WHERE i.Matr=a.Matr AND p.CodP=a.CodP AND budget>='50000' AND p.Nome='Microsoft'
GROUP BY Matr
HAVING COUNT (CodP)=(SELECT COUNT (CodP) FROM Progetti
WHERE Nome='Microsoft');


Tanto per avere la certezza che funziona! Grazie


direi che manca l'ultimo pezzo

SELECT i.Matr
FROM Progetti p, Impiegati i, Assegnamento a
WHERE i.Matr=a.Matr AND p.CodP=a.CodP AND budget>='50000' AND p.Nome='Microsoft'
GROUP BY Matr
HAVING COUNT (CodP)=(SELECT COUNT (CodP) FROM Progetti
WHERE Nome='Microsoft' AND budget>='50000');

21-02-2008 16:57
Click Here to See the Profile for tolarian Click here to Send tolarian a Private Message Find more posts by tolarian Add tolarian to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carlinus
.precettore.

User info:
Registered: Nov 2004
Posts: 85 (0.01 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3
Time Online: 1 Day, 8:08:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

cmq come avete fatto la query:

Determinare gli impiegati che non sono stati assegnati ad alcun progetto?

io l'ho fatta così

SELECT i.nome
FROM Impiegati i
WHERE i.Matr NOT IN (SELECT i.Matr FROM Impiegati i, Progetti p, Assegnamento a WHERE i.matr=a.matr and p.codP=a.codP)

il concetto che ho cercato di scrivere è cerco gli impiegati che sono stati assegnati a qualche progetto se la matr nn è in qst elenco allora vuol dire che quell'impiegato nn è stato assegnato a nessun progetto


Last edited by carlinus on 21-02-2008 at 17:03

21-02-2008 17:00
Click Here to See the Profile for carlinus Click here to Send carlinus a Private Message Find more posts by carlinus Add carlinus to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
tolarian
Il Mezzorco Druido

User info:
Registered: Oct 2004
Posts: 144 (0.02 al dì)
Location: Biella
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 13:36:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by carlinus
cmq come avete fatto la query:

Determinare gli impiegati che non sono stati assegnati ad alcun progetto?

io l'ho fatta così

SELECT i.nome
FROM Impiegati i
WHERE i.Matr NOT IN (SELECT i.Matr FROM Impiegati i, Progetti p, Assegnamento a WHERE i.matr=a.matr and p.codP=a.codP)

il concetto che ho cercato di scrivere è cerco gli impiegati che sono stati assegnati a qualche progetto se la matr nn è in qst elenco allora vuol dire che quell'impiegato nn è stato assegnato a nessun progetto


Cosa ne dite di questa?

SELECT i.matr
FROM impiegati i, progetti p, assegnamento a
WHERE i.matr=a.matr AND a.codP=p.codP AND not exists (SELECT a.matr FROM impiegati i, progetti p, assegnamento a WHERE i.matr=a.matr AND a.codP=p.codP)
GROUP BY i.matr

21-02-2008 17:03
Click Here to See the Profile for tolarian Click here to Send tolarian a Private Message Find more posts by tolarian Add tolarian to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
carlinus
.precettore.

User info:
Registered: Nov 2004
Posts: 85 (0.01 al dì)
Location:
Corso: Comunicazione Digitale
Anno: 3
Time Online: 1 Day, 8:08:11 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

nn saprei alla fine l'interragazione è uguale alla sottointerrogazione

21-02-2008 17:07
Click Here to See the Profile for carlinus Click here to Send carlinus a Private Message Find more posts by carlinus Add carlinus to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ARIEL
.grande:maestro.

User info:
Registered: Jul 2005
Posts: 636 (0.08 al dì)
Location: milano
Corso: Comunicazione digitale
Anno: Dottoressa!!!
Time Online: 12 Days, 7:36:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by tolarian
Cosa ne dite di questa?

SELECT i.matr
FROM impiegati i, progetti p, assegnamento a
WHERE i.matr=a.matr AND a.codP=p.codP AND not exists (SELECT a.matr FROM impiegati i, progetti p, assegnamento a WHERE i.matr=a.matr AND a.codP=p.codP)
GROUP BY i.matr




Non so però nella prima select già colleghi le matricole di Impiegati con Assegnamento mentre se un impiegato non ha progetti assegnati la sua matricola non compare

21-02-2008 17:12
Click Here to See the Profile for ARIEL Click here to Send ARIEL a Private Message Find more posts by ARIEL Add ARIEL to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Kardo
.consigliere.

User info:
Registered: Oct 2003
Posts: 113 (0.01 al dì)
Location:
Corso: Comunicazione Digitale
Anno: Nella speranza di finire
Time Online: 1 Day, 4:47:26 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Quella di carlinus mi sembra corretta.
Richiedo l'elenco di coloro che hanno partecipato a un progetto e poi gli dico che quello che cerco non è in quell'insieme.

21-02-2008 17:22
Click Here to See the Profile for Kardo Click here to Send Kardo a Private Message Find more posts by Kardo Add Kardo to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
tolarian
Il Mezzorco Druido

User info:
Registered: Oct 2004
Posts: 144 (0.02 al dì)
Location: Biella
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 13:36:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

sono fuso ormai :) cmq in una NOT IN posso mettere una colonna di una select??

dato che di solito è NOT IN (10,20,30) dove 10,20,30 sono i valori che voglio far escludere...

grazie

21-02-2008 17:46
Click Here to See the Profile for tolarian Click here to Send tolarian a Private Message Find more posts by tolarian Add tolarian to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ARIEL
.grande:maestro.

User info:
Registered: Jul 2005
Posts: 636 (0.08 al dì)
Location: milano
Corso: Comunicazione digitale
Anno: Dottoressa!!!
Time Online: 12 Days, 7:36:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Si è possibile infatti nelle slide c'è un esempio:
Elencare i titoli dei film di Quentin Tarantino usciti in un anno in cui non sono usciti film di Tim Burton

la soluzione del prof:

SELECT titolo
FROM Film
WHERE regista='Quentin tarantino' AND anno NOT IN (SELECT anno FROM Film WHERE regista='Tim Burton');

anche perche la select mi pare ti vada a scegliere dei valori secondo le condizioni che metti!

21-02-2008 17:53
Click Here to See the Profile for ARIEL Click here to Send ARIEL a Private Message Find more posts by ARIEL Add ARIEL to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
tolarian
Il Mezzorco Druido

User info:
Registered: Oct 2004
Posts: 144 (0.02 al dì)
Location: Biella
Corso: Comunicazione Digitale
Anno:
Time Online: 1 Day, 13:36:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ARIEL
Si è possibile infatti nelle slide c'è un esempio:
Elencare i titoli dei film di Quentin Tarantino usciti in un anno in cui non sono usciti film di Tim Burton

la soluzione del prof:

SELECT titolo
FROM Film
WHERE regista='Quentin tarantino' AND anno NOT IN (SELECT anno FROM Film WHERE regista='Tim Burton');

anche perche la select mi pare ti vada a scegliere dei valori secondo le condizioni che metti!


ottimo...grazie

21-02-2008 17:57
Click Here to See the Profile for tolarian Click here to Send tolarian a Private Message Find more posts by tolarian Add tolarian to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 10:50.    Post New Thread    Post A Reply
Pages (8): « First ... « 3 4 5 6 [7] 8 »   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.142 seconds (64.72% PHP - 35.28% MySQL) con 24 query.