[DB] n-aire relaties

Forum van 2de Bachelor Informatica.

Moderator: Praesidium

User avatar
Robbe
WOZ
Posts: 2161
Contact:

[DB] n-aire relaties

Post#1 » Sat Nov 25, 2006 6:43 pm

Na de algemene opmerking van Wim in het labo over de ternaire relaties en na de feedback op het verslag, ben ik eens die n-aire relaties gaan bekijken in de cursus.
cursus, p 49 wrote:in n-ary relationships, an i..j associated to an entity set E means that if we select one entity of the other entity sets in the relationship, those entities are related to at least i (at most j) entities of E;
Hieruit versta ik dus dat als je van 1 entiteit de kardinaleit (ik veronderstel hier even dat dit het getal is dat op de lijn tussen de entiteit en de relatie, staat) wilt weten, je dat moet zien als alle andere entiteiten in de relatie vast zijn gekozen.

Even een voorbeeldje hierbij: Stel een ternaire relatie met entiteiten User, Picture en Comment. Om dan te weten wat de kardinaliteit van User is, worden Picture en Comment dus vast verondersteld. Elke combinatie van een Picture en een Comment is dan geassocieerd met een aantal Users, logisch gezien juist 1.


Blijkbaar is dit fout als ik Wim mag geloven.

Kan iemand hier wat meer duidelijkheid over geven?
"I'm not afraid of falling, I'm afraid of landing" -- Sam
How To Ask Questions The Smart Way

Zingen? UKA-n dat ook!

0g1op
Posts: 89

Post#2 » Sat Nov 25, 2006 6:52 pm

Ik zou zeggen 0 - 1.
Bv:
U1, P1, C1
U2, P2, C2

Als je P1 en C2 neemt, dan is er geen user voor.

User avatar
Robbe
WOZ
Posts: 2161
Contact:

Post#3 » Sat Nov 25, 2006 7:14 pm

Maar je neemt P1 en C2 niet, want C2 is geen comment bij P1. Of doe je dit wel in een ternaire relatie?
"I'm not afraid of falling, I'm afraid of landing" -- Sam
How To Ask Questions The Smart Way

Zingen? UKA-n dat ook!

User avatar
EagleEye812
Posts: 406

Post#4 » Sat Nov 25, 2006 7:32 pm

heh
Boek: (notatie met pijltjes)
In Fig. 2.4 we have an arrow pointing to entity set Studios, indicating that for a particular star and movie, there is only one studio with which the star has contracted for that movie.
Cursus: (notatie met X..X kardinaliteit)
It is not representable here that a movie is exactly associated to one studio.
Handig...
[quote="zarry"][url=http://www.winak.be/forum/viewtopic.php?p=12475#12475]wickaaaah! thcikci tschiki paaaauuuuw wicked-original![/url][/quote]

User avatar
Robbe
WOZ
Posts: 2161
Contact:

Post#5 » Sat Nov 25, 2006 7:36 pm

EagleEye812 wrote:heh
Boek: (notatie met pijltjes)
In Fig. 2.4 we have an arrow pointing to entity set Studios, indicating that for a particular star and movie, there is only one studio with which the star has contracted for that movie.
Cursus: (notatie met X..X kardinaliteit)
It is not representable here that a movie is exactly associated to one studio.
Handig...
OK, dan heb ik het bij deze dus niet door... :( help?
"I'm not afraid of falling, I'm afraid of landing" -- Sam
How To Ask Questions The Smart Way

Zingen? UKA-n dat ook!

User avatar
EagleEye812
Posts: 406

Post#6 » Sat Nov 25, 2006 7:48 pm

Ik zeg gewoon dat de notatie die wij in de les hanteren mij niet echt handig lijkt? Maar ik heb de cursus nog niet bestudeerd daar... En het handboek heeft me niet kunnen helpen :P
[quote="zarry"][url=http://www.winak.be/forum/viewtopic.php?p=12475#12475]wickaaaah! thcikci tschiki paaaauuuuw wicked-original![/url][/quote]

0g1op
Posts: 89

Post#7 » Sat Nov 25, 2006 7:58 pm

Ge hebt eigenlijk volgende relatie

PxC -> U

Dus je kan wel het element (P1, C2) hebben, maar hiervoor bestaat er geen user.

Je gaat nog niet op voorhand kijken of het bij elkaar past he. Je gaat gewoon achteraf zien dat er geen user voor is. Of mss meerdere als ze dezelfde P en C kunnen hebben.

Return to “2de Bachelor”

Who is online

Users browsing this forum: No registered users and 38 guests