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 > [Help] Vecchi temi d'esame
Pages (2): [1] 2 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
PablitoEscobar
.precettore.

User info:
Registered: Oct 2003
Posts: 81 (0.01 al dì)
Location: Colombia
Corso: comunicazione digitale
Anno: terzo
Time Online: 2 Days, 21:30:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Help] Vecchi temi d'esame

Ciao a tutti,
Ho un problema su uno schema ER dell'esame di luglio 2005 Mazzoleni/Perlasca.(1° esercizio).
Io come Entita ho individuato che:

Studenti ---> ESAMI(data, voto)---> Corsi (molti a molti)
Corsi---> TIENE ---> Docente (molti a moli)

Il mio problema e' riguardo i turni che nn capisco se fare un'altra entita turni oppure legarla come attributo all'entita o docente o corsi. ma non so come.

Qualcuno che m puo' aiutare?

Allego il link del file alla quale m sto riferendo:
http://www.dsy.it/forum/attachment.php?s=&postid=355515

20-01-2007 17:57
Click Here to See the Profile for PablitoEscobar Click Here to See the Blog of PablitoEscobar Click here to Send PablitoEscobar a Private Message Find more posts by PablitoEscobar Add PablitoEscobar to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Io il turno lo legherei semplicemente all'entità corso e metterei quindi come chiave primaria "Nome_Corso" e "Turno" oppure un id..

le iscrizioni degli studenti ai corsi invece come le gestisci??

24-01-2007 11:43
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
PablitoEscobar
.precettore.

User info:
Registered: Oct 2003
Posts: 81 (0.01 al dì)
Location: Colombia
Corso: comunicazione digitale
Anno: terzo
Time Online: 2 Days, 21:30:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ti posto quello che potrebbe essere uno schema ER sensato + le relazioni secondo me.
Dimmi che ne pensi e se potrebbe avere senso

Attachment: schema_er_es1.bmp
This has been downloaded 43 time(s).

24-01-2007 16:40
Click Here to See the Profile for PablitoEscobar Click Here to See the Blog of PablitoEscobar Click here to Send PablitoEscobar a Private Message Find more posts by PablitoEscobar Add PablitoEscobar to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

secondo me ci sono un po' di cose che non vanno..
domani se ho tempo provo a postare come lo farei io..
ciao

24-01-2007 22:55
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ok, io l'ho fatto così, ti passo direttamente il db da dove puoi vedere tutto (query comprese)... ;)

Attachment: dbcomdig.rar
This has been downloaded 34 time(s).

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

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Posto un altro vecchio tema, aprile 2006, la cui soluzione nell'area filez secondo me è sbagliata (lo schema relazionale)..
fatemi sapere che ne pensate..

Attachment: basi_aprile.rar
This has been downloaded 36 time(s).

25-01-2007 20:50
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ked
------

User info:
Registered: Oct 2003
Posts: 76 (0.01 al dì)
Location:
Corso: Com.Dig
Anno: 3
Time Online: 3 Days, 5:56:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by -MICKY-
Posto un altro vecchio tema, aprile 2006,


anche secondo me ha sbagliato: basta mettere cod_responsabile (che può essere nullo se lui è un responsabile) nella tabella Commesso.

invece nella query2:
SELECT DISTINCT Nome
FROM Prodotto, Compra
WHERE Cod_Prodotto = cod_p#
AND YEAR(data_acq) = 2000
GROUP BY Nome
ORDER BY Nome;

fa un raggruppamento sul nome e poi un distinct ancora sul nome...
Ti da lo stesso risultato se usi singolarmente Distinct o Group ma utilizarli tutte e due è inutile...no? che dite??

__________________
:arrow:

29-01-2007 11:53
Click Here to See the Profile for ked Click here to Send ked a Private Message Find more posts by ked Add ked to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ked
anche secondo me ha sbagliato: basta mettere cod_responsabile (che può essere nullo se lui è un responsabile) nella tabella Commesso.


esatto

Originally posted by ked

invece nella query2:
SELECT DISTINCT Nome
FROM Prodotto, Compra
WHERE Cod_Prodotto = cod_p#
AND YEAR(data_acq) = 2000
GROUP BY Nome
ORDER BY Nome;

fa un raggruppamento sul nome e poi un distinct ancora sul nome...
Ti da lo stesso risultato se usi singolarmente Distinct o Group ma utilizarli tutte e due è inutile...no? che dite??


concordo, è sufficiente uno dei 2..

29-01-2007 12:24
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
shiffola
dsy core staff

User info:
Registered: Jan 2004
Posts: 916 (0.11 al dì)
Location: milano
Corso: ticom
Anno: 1
Time Online: 13 Days, 17:25:44 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

a distanza di mesi non posso dirti come l'avevo pensata, comunque senza distinct, dopo aver raggruppato, potrebbe scriverti più righe aventi lo stesso nome, aggiungendo quella clausola invece dovrebbe scrivere il nome anche se appare più volte nella tabella. In ogni caso potrebbe anche essere che sia sbagliata, nel caso non mi ha segnato l'errore ;)

29-01-2007 13:48
Click Here to See the Profile for shiffola Click Here to See the Blog of shiffola Click here to Send shiffola a Private Message Find more posts by shiffola Add shiffola to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ked
------

User info:
Registered: Oct 2003
Posts: 76 (0.01 al dì)
Location:
Corso: Com.Dig
Anno: 3
Time Online: 3 Days, 5:56:52 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ecco la mia versione, logicamente diversa dalla vostra ;-))
premetto che il testo per me non è chiarissimo infatti:
1) io considero le tabelle Corsi ed Esami uguali...così non ripeto dei dati che ho di già in una tabella.

2) non specifica espressamente la suddivisione per turni degli studenti e quindi questo non lo considero..semmai è uguale alla soluzione per i docenti.

.... cosa ne pensate??

L'ultima query, quella che richiede il nome dello studente con il maggior numero di tentativi, come l'avete fatta??

Attachment: 2005.doc
This has been downloaded 15 time(s).

__________________
:arrow:

29-01-2007 15:43
Click Here to See the Profile for ked Click here to Send ked a Private Message Find more posts by ked Add ked to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ked

L'ultima query, quella che richiede il nome dello studente con il maggior numero di tentativi, come l'avete fatta??



bisognerebbe contare i tentavi e prendere il maggiore ma secondo me non si può fare con una query sola..
io ho contato i tentativi e li ho ordinati dal più alto al più basso (è praticamente l'equivalente)
dovrebbe andar bene cmq credo..

29-01-2007 16:27
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
PablitoEscobar
.precettore.

User info:
Registered: Oct 2003
Posts: 81 (0.01 al dì)
Location: Colombia
Corso: comunicazione digitale
Anno: terzo
Time Online: 2 Days, 21:30:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by -MICKY-
bisognerebbe contare i tentavi e prendere il maggiore ma secondo me non si può fare con una query sola..
io ho contato i tentativi e li ho ordinati dal più alto al più basso (è praticamente l'equivalente)
dovrebbe andar bene cmq credo..



forse una roba del genere :

Select Studenti.nome, MAX(COUNT(*))
from Studenti, Corsi, Sostenuto
where Studenti.ID_Studenti = Sostenuto.ID_Studenti,
and Corsi.ID_Studenti = Sostenuto.ID_Studenti,
and Corsi.nome = "Informatica applicata",
and Sostenuto.voto <18,
Group by Studenti.nome.

Oppure sicuramente nel db di Micky

SELECT studente.Cognome, esame.matricola, count(Esame.matricola) AS NumVolteNonSuperatoEsameLabInfApplicata
FROM Esame, studente
WHERE esame.matricola=studente.matricola and voto<18 and nome_corso="LabInfApplicata"
GROUP BY cognome, esame.matricola
HAVING COUNT(esame.matricola) >=ALL (
SELECT count(Esame.matricola) AS NumVolteNonSuperatoEsameLabInfApplicata
FROM Esame, studente
WHERE esame.matricola=studente.matricola and voto<18 and nome_corso="LabInfApplicata"
GROUP BY cognome, esame.matricola


)

Last edited by PablitoEscobar on 30-01-2007 at 16:36

30-01-2007 16:10
Click Here to See the Profile for PablitoEscobar Click Here to See the Blog of PablitoEscobar Click here to Send PablitoEscobar a Private Message Find more posts by PablitoEscobar Add PablitoEscobar to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by PablitoEscobar
forse una roba del genere :

Select Studenti.nome, MAX(COUNT(*))
from Studenti, Corsi, Sostenuto
where Studenti.ID_Studenti = Sostenuto.ID_Studenti,
and Corsi.ID_Studenti = Sostenuto.ID_Studenti,
and Corsi.nome = "Informatica applicata",
and Sostenuto.voto <18,
Group by Studenti.nome.


max(count(*)) l'avevo provato anch'io ma non si può fare..

30-01-2007 17:18
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
-MICKY-
.grande:maestro.

User info:
Registered: Dec 2003
Posts: 507 (0.06 al dì)
Location: Milano
Corso: com dig
Anno: Doctor
Time Online: 4 Days, 5:26:54 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged



Oppure sicuramente nel db di Micky

SELECT studente.Cognome, esame.matricola, count(Esame.matricola) AS NumVolteNonSuperatoEsameLabInfApplicata
FROM Esame, studente
WHERE esame.matricola=studente.matricola and voto<18 and nome_corso="LabInfApplicata"
GROUP BY cognome, esame.matricola
HAVING COUNT(esame.matricola) >=ALL (
SELECT count(Esame.matricola) AS NumVolteNonSuperatoEsameLabInfApplicata
FROM Esame, studente
WHERE esame.matricola=studente.matricola and voto<18 and nome_corso="LabInfApplicata"
GROUP BY cognome, esame.matricola


) [/B]


sì questa va ;)

30-01-2007 17:31
Click Here to See the Profile for -MICKY- Click here to Send -MICKY- a Private Message Find more posts by -MICKY- Add -MICKY- to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
PablitoEscobar
.precettore.

User info:
Registered: Oct 2003
Posts: 81 (0.01 al dì)
Location: Colombia
Corso: comunicazione digitale
Anno: terzo
Time Online: 2 Days, 21:30:22 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by -MICKY-
max(count(*)) l'avevo provato anch'io ma non si può fare..



Da quello che ho capito solo in Access perche' MySQL lo accetta.

30-01-2007 17:35
Click Here to See the Profile for PablitoEscobar Click Here to See the Blog of PablitoEscobar Click here to Send PablitoEscobar a Private Message Find more posts by PablitoEscobar Add PablitoEscobar to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 22:52.    Post New Thread    Post A Reply
Pages (2): [1] 2 »   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.143 seconds (56.55% PHP - 43.45% MySQL) con 24 query.