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 > SQL Problem...
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
vittorio
.fedelissimo.

User info:
Registered: Jul 2007
Posts: 43 (0.01 al dì)
Location: San donato Milanese
Corso: Informatica
Anno: dunque...ieri era?
Time Online: 12:43:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
Unhappy SQL Problem...

hola raga...mi potete dare una dritta su sta relazione?

/* chiavi primarie in grassetto e chiavi esterne sottolineate */

MACCHINISTA (CF, Nome, Cognome, Età)
TRENO (ID-Treno, Tipo(ES/IC/IR/D), Lunghezza, Ristorante(S/N))
PERCORRENZA (CF, ID-Treno, Nome-linea , Nr-fermate)

Determinare in SQL CF, Nome e Cognome dei macchinisti di treni euro star elencandoli in ordine alfabetico per cognome;

Determinare in SQL il CF dei macchinisti che percorrono il maggior numero di linee diverse

17-01-2009 15:17
Click Here to See the Profile for vittorio Click here to Send vittorio a Private Message Find more posts by vittorio Add vittorio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gimmy
.consigliere.

User info:
Registered: Jun 2008
Posts: 117 (0.02 al dì)
Location: Palazzolo Milanese
Corso: Informatica Magistrale
Anno:
Time Online: 22:56:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

io le ho risolte cosi...

select m.cf,nome,cognome
from macchinista m, treno t, percorrenza p
where m.cf=p.cf and t.id_treno=p.id_treno and tipo='es'
order by cognome

select m.cf
from macchinista m inner join percorrenza p on m.cf=p.cf
group by m.cf
having count(distinct nome_linea)>= all (select count(distinct nome_linea)
from macchinista m inner join percorrenza p on m.cf=p.cf
group by m.cf)

18-01-2009 15:40
Click Here to See the Profile for Gimmy Click here to Send Gimmy a Private Message Find more posts by Gimmy Add Gimmy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
vittorio
.fedelissimo.

User info:
Registered: Jul 2007
Posts: 43 (0.01 al dì)
Location: San donato Milanese
Corso: Informatica
Anno: dunque...ieri era?
Time Online: 12:43:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

io inveve la prima l'ho risolta così:

SELECT m.cognome, m.nome, m.cf
FROM macchinista JOIN percorrenza ON (macchinista.cf = percorrenza.cf) JOIN treno ON (percorrenza.treno = treno.idtreno)
WHERE treno.tipo="ES"
ORDER BY macchinista.cognome

la seconda non l'ho ancora risolta...

18-01-2009 16:03
Click Here to See the Profile for vittorio Click here to Send vittorio a Private Message Find more posts by vittorio Add vittorio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gimmy
.consigliere.

User info:
Registered: Jun 2008
Posts: 117 (0.02 al dì)
Location: Palazzolo Milanese
Corso: Informatica Magistrale
Anno:
Time Online: 22:56:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si è uguale, solo che tu hai fatto le join mentre io ho fatto il confronto fra chiavi esterne

18-01-2009 16:14
Click Here to See the Profile for Gimmy Click here to Send Gimmy a Private Message Find more posts by Gimmy Add Gimmy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
vittorio
.fedelissimo.

User info:
Registered: Jul 2007
Posts: 43 (0.01 al dì)
Location: San donato Milanese
Corso: Informatica
Anno: dunque...ieri era?
Time Online: 12:43:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Sì sì...esattamente...ma tu devi fare l'appello del 20?

18-01-2009 16:38
Click Here to See the Profile for vittorio Click here to Send vittorio a Private Message Find more posts by vittorio Add vittorio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Gimmy
.consigliere.

User info:
Registered: Jun 2008
Posts: 117 (0.02 al dì)
Location: Palazzolo Milanese
Corso: Informatica Magistrale
Anno:
Time Online: 22:56:53 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

si perchè?

18-01-2009 16:49
Click Here to See the Profile for Gimmy Click here to Send Gimmy a Private Message Find more posts by Gimmy Add Gimmy to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
vittorio
.fedelissimo.

User info:
Registered: Jul 2007
Posts: 43 (0.01 al dì)
Location: San donato Milanese
Corso: Informatica
Anno: dunque...ieri era?
Time Online: 12:43:36 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

No, così chiedevo...hai visto il progetto?? ci sono molti dubbi inerenti ai turni di gioco. bah..

19-01-2009 10:11
Click Here to See the Profile for vittorio Click here to Send vittorio a Private Message Find more posts by vittorio Add vittorio to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 08:21.    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.035 seconds (77.41% PHP - 22.59% MySQL) con 26 query.