<div dir="ltr">ah, a ver si te entendí, lo planteé diferente:<div style>como no estoy repitiendo datos, sino una referencia, puse dos id_ciudad en Direcciones, uno para cada dirección</div><div style>( sospecho que acá también está como obligatoria la alternativa, no? )</div>
<div><br></div><div><table border="0" cellpadding="0" cellspacing="0" width="490" style="border-collapse:collapse;width:367pt">
<colgroup><col width="139" style="width:104pt">
<col width="32" style="width:24pt">
<col width="83" style="width:62pt">
<col width="27" style="width:20pt">
<col width="70" style="width:53pt">
<col width="28" style="width:21pt">
<col width="111" style="width:83pt">
</colgroup><tbody><tr height="20" style="height:15pt">
<td height="20" class="" width="139" style="height:15pt;width:104pt"><b>Socios</b></td>
<td width="32" style="width:24pt"></td>
<td class="" width="83" style="width:62pt"><b>Ciudades</b></td>
<td width="27" style="width:20pt"></td>
<td class="" width="70" style="width:53pt"><b>Provincias</b></td>
<td width="28" style="width:21pt"></td>
<td class="" width="111" style="width:83pt"><b>Direcciones</b></td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">id</td>
<td></td>
<td class="">id</td>
<td></td>
<td class="">id</td>
<td></td>
<td class="">id</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">apellidos</td>
<td></td>
<td class="">nombre</td>
<td></td>
<td class="">nombre</td>
<td></td>
<td class="">id_socio</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">nombres</td>
<td></td>
<td class="">cp</td>
<td></td>
<td class="">id_país</td>
<td></td>
<td class="">dirección_prin</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">teléfono</td>
<td></td>
<td class="">id_provincia</td>
<td></td>
<td></td>
<td></td>
<td class="">id_ciudad</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">id_direccion</td>
<td></td>
<td></td>
<td></td>
<td class=""><b>Países</b></td>
<td></td>
<td class="">dirección_alt</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" style="height:15pt"></td>
<td></td>
<td></td>
<td></td>
<td class="">id</td>
<td></td>
<td class="">id_ciudad</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" style="height:15pt"></td>
<td></td>
<td></td>
<td></td>
<td class="">nombre</td>
<td></td>
<td></td>
</tr></tbody></table><br></div><div><br></div><div style>entonces creo que podría ser así:</div><div><br></div><div><br></div><div><table border="0" cellpadding="0" cellspacing="0" width="490" style="border-collapse:collapse;width:367pt">
<colgroup><col width="139" style="width:104pt">
<col width="32" style="width:24pt">
<col width="83" style="width:62pt">
<col width="27" style="width:20pt">
<col width="70" style="width:53pt">
<col width="28" style="width:21pt">
<col width="111" style="width:83pt">
</colgroup><tbody><tr height="20" style="height:15pt">
<td height="20" class="" width="139" style="height:15pt;width:104pt"><b>Socios</b></td>
<td width="32" style="width:24pt"></td>
<td class="" width="83" style="width:62pt"><b>Ciudades</b></td>
<td width="27" style="width:20pt"></td>
<td class="" width="70" style="width:53pt"><b>Provincias</b></td>
<td width="28" style="width:21pt"></td>
<td class="" width="111" style="width:83pt"><b>Direcciones</b></td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">id</td>
<td></td>
<td class="">id</td>
<td></td>
<td class="">id</td>
<td></td>
<td class="">id</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">apellidos</td>
<td></td>
<td class="">nombre</td>
<td></td>
<td class="">nombre</td>
<td></td>
<td class="">id_socio</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">nombres</td>
<td></td>
<td class="">cp</td>
<td></td>
<td class="">id_país</td>
<td></td>
<td class="">dirección</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt">teléfono</td>
<td></td>
<td class="">id_provincia</td>
<td></td>
<td></td>
<td></td>
<td class="">id_ciudad</td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" class="" style="height:15pt"><br></td>
<td></td>
<td></td>
<td></td>
<td class=""><b>Países</b></td>
<td></td>
<td></td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" style="height:15pt"></td>
<td></td>
<td></td>
<td></td>
<td class="">id</td>
<td></td>
<td></td>
</tr>
<tr height="20" style="height:15pt">
<td height="20" style="height:15pt"></td>
<td></td>
<td></td>
<td></td>
<td class="">nombre</td>
<td></td>
<td></td>
</tr></tbody></table></div><div><br></div><div style>Cuando me decís que no dependen exclusivamente del Socio, es porque dependen también de la ciudad, no?</div><div><br></div><div style>Los demás también están mal? uh, se ve que no termino de entender cómo determinar la dependencia de las claves entonces....</div>
<div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">El 20 de junio de 2013 18:08, Leonardo Tadei - Pegasus Tech Supply <span dir="ltr"><<a href="mailto:leonardot@pegasusnet.com.ar" target="_blank">leonardot@pegasusnet.com.ar</a>></span> escribió:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ariel,<br>
<br>
El mié, 19-06-2013 a las 23:57 -0300, Ariel Fernández escribió:<br>
<div class="im">> ok, para distinguir una dirección de otra, las almaceno en tablas<br>
> diferentes.<br>
<br>
</div> Casi casi... hiciste que la dirección alternativa sea obligatoria.<br>
<br>
Estás planteando mal las dependencias de la clave primaria, en este y<br>
en los demás ejercicios.<br>
En este caso, las direcciones dependen del socio, pero no dependen<br>
exclusivamente del socio, y por eso no van ahí; en cambio en las tablas<br>
de Direcciones, estas sí dependen del socio, pero no hay referencia a<br>
él.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> Socios<br>
><br>
> Ciudades<br>
><br>
> Provincias<br>
><br>
> Direcciones_alt<br>
> id<br>
><br>
> id<br>
><br>
> id<br>
><br>
> id<br>
> apellidos<br>
><br>
> nombre<br>
><br>
> nombre<br>
><br>
> dirección<br>
> nombres<br>
><br>
> cp<br>
><br>
> id_país<br>
><br>
> id_ciudad<br>
> teléfono<br>
><br>
> id_provincia<br>
><br>
><br>
><br>
><br>
> id_direccion_alt<br>
><br>
><br>
><br>
><br>
> Países<br>
><br>
> Direcciones_prin<br>
> id_direccion_prin<br>
><br>
><br>
><br>
> id<br>
><br>
> id<br>
><br>
><br>
><br>
><br>
><br>
> nombre<br>
><br>
> dirección<br>
><br>
><br>
><br>
><br>
><br>
><br>
> id_ciudad<br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
><br>
> El 19 de junio de 2013 23:38, Leonardo Tadei - Pegasus Tech Supply<br>
> <<a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a>> escribió:<br>
> Ariel,<br>
><br>
> las direcciones se pueden poner en cualquier lado: lo<br>
> que estamos<br>
> tratando de ver es dónde dicen las Formas Normales que irían<br>
> (y por qué!<br>
> ).<br>
><br>
> El planteo del problema da cierta flexibilidad al<br>
> almacenamiento: la<br>
> pregunta que te tenés que responder es: cómo distinguís que<br>
> una<br>
> dirección es la principal o la secundaria?<br>
><br>
> Por otra parte, e independientemente de cómo te<br>
> respondas la pregunta<br>
> anterior, no hay repetición en las ciudades, de la misma forma<br>
> que no<br>
> hay repetición en el tipo de documento cuando en una tabla lo<br>
> usan todos<br>
> los registros, ya que es una referencia a un dato que está una<br>
> sola vez<br>
> almacenado.<br>
><br>
> Seguimos!<br>
><br>
><br>
> El mié, 19-06-2013 a las 21:26 -0300, Ariel Fernández<br>
> escribió:<br>
> > O sea que iría cada dirección en una tabla aparte ? o se<br>
> pueden poner<br>
> > ambas en una sola tabla? ah, pero en ese caso si la ciudad<br>
> es la<br>
> > misma, la estaría repitiendo....<br>
> ><br>
> ><br>
> ><br>
> ><br>
> > El 18 de junio de 2013 22:06, Leonardo Tadei - Pegasus Tech<br>
> Supply<br>
> > <<a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a>> escribió:<br>
> > Tibio... por el mismo motivo que la dirección<br>
> alternativa va<br>
> > en otra<br>
> > tabla (la 3FN) la principal también va afuera porque<br>
> no<br>
> > depende<br>
> > exclusivamente de la clave primaria...<br>
> ><br>
> ><br>
> > El mar, 18-06-2013 a las 21:15 -0300, Ariel<br>
> Fernández<br>
> > escribió:<br>
> > > ok, una dirección principal en el Socio, y la<br>
> alternativa en<br>
> > otra<br>
> > > tabla:<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > Socios<br>
> > ><br>
> > > Ciudades<br>
> > ><br>
> > > Provincias<br>
> > ><br>
> > > Direcciones_alt<br>
> > > id<br>
> > ><br>
> > > id<br>
> > ><br>
> > > id<br>
> > ><br>
> > > id<br>
> > > apellidos<br>
> > ><br>
> > > nombre<br>
> > ><br>
> > > nombre<br>
> > ><br>
> > > dirección<br>
> > > nombres<br>
> > ><br>
> > > cp<br>
> > ><br>
> > > id_país<br>
> > ><br>
> > > id_ciudad<br>
> > > dirección_principal<br>
> > ><br>
> > > id_provincia<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > teléfono<br>
> > ><br>
> > ><br>
> > ><br>
> > > Países<br>
> > ><br>
> > ><br>
> > > id_ciudad<br>
> > ><br>
> > ><br>
> > ><br>
> > > id<br>
> > ><br>
> > ><br>
> > > id_direccion_alt<br>
> > ><br>
> > ><br>
> > ><br>
> > > nombre<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> > > 2013/6/17 Leonardo Tadei - Pegasus Tech Supply<br>
> > > <<a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a>><br>
> > > No... las direcciones pueden ser de<br>
> diferentes<br>
> > ciudades...<br>
> > ><br>
> > ><br>
> > ><br>
> > > El lun, 17-06-2013 a las 21:16 -0300,<br>
> Ariel<br>
> > Fernández<br>
> > > escribió:<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > Socios<br>
> > > ><br>
> > > > Ciudades<br>
> > > ><br>
> > > > Provincias<br>
> > > > id<br>
> > > ><br>
> > > > id<br>
> > > ><br>
> > > > id<br>
> > > > apellidos<br>
> > > ><br>
> > > > nombre<br>
> > > ><br>
> > > > nombre<br>
> > > > nombres<br>
> > > ><br>
> > > > cp<br>
> > > ><br>
> > > > id_país<br>
> > > > dirección_principal<br>
> > > ><br>
> > > > id_provincia<br>
> > > ><br>
> > > ><br>
> > > > dirección_alternativa<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > Países<br>
> > > > teléfono<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > id<br>
> > > > id_ciudad<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > > > nombre<br>
> > > ><br>
> > > ><br>
> > > ><br>
> > ><br>
> > > ><br>
> _______________________________________________<br>
> > > > Php-avanzado mailing list<br>
> > > > <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> > > ><br>
> > ><br>
> ><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
> > ><br>
> > > --<br>
> > > Leonardo Tadei<br>
> > > <a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a><br>
> > > Web: <a href="http://leonardo.tadei.com.ar" target="_blank">http://leonardo.tadei.com.ar</a><br>
> > > Firma pública:<br>
> > ><br>
> ><br>
> <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
> > ><br>
> > ><br>
> _______________________________________________<br>
> > > Php-avanzado mailing list<br>
> > > <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> > ><br>
> ><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
> > ><br>
> > ><br>
> > > _______________________________________________<br>
> > > Php-avanzado mailing list<br>
> > > <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> > ><br>
> ><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
> ><br>
> > --<br>
> > Leonardo Tadei<br>
> > <a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a><br>
> > Web: <a href="http://leonardo.tadei.com.ar" target="_blank">http://leonardo.tadei.com.ar</a><br>
> > Firma pública:<br>
> ><br>
> <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
> ><br>
> > _______________________________________________<br>
> > Php-avanzado mailing list<br>
> > <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> ><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
> ><br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Php-avanzado mailing list<br>
> > <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> ><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
><br>
> --<br>
> Leonardo Tadei<br>
> <a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a><br>
> Web: <a href="http://leonardo.tadei.com.ar" target="_blank">http://leonardo.tadei.com.ar</a><br>
> Firma pública:<br>
> <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
><br>
> _______________________________________________<br>
> Php-avanzado mailing list<br>
> <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Php-avanzado mailing list<br>
> <a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
> <a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
<br>
--<br>
Leonardo Tadei<br>
<a href="mailto:leonardot@pegasusnet.com.ar">leonardot@pegasusnet.com.ar</a><br>
Web: <a href="http://leonardo.tadei.com.ar" target="_blank">http://leonardo.tadei.com.ar</a><br>
Firma pública: <a href="http://www.pegasusnet.com.ar/LeonardoTadei-public.key" target="_blank">http://www.pegasusnet.com.ar/LeonardoTadei-public.key</a><br>
<br>
_______________________________________________<br>
Php-avanzado mailing list<br>
<a href="mailto:Php-avanzado@pato2.fi.mdp.edu.ar">Php-avanzado@pato2.fi.mdp.edu.ar</a><br>
<a href="http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado" target="_blank">http://www3.fi.mdp.edu.ar/cgi-bin/mailman/listinfo/php-avanzado</a><br>
</div></div></blockquote></div><br></div>