logo       

Re: Relacionamentos: msg#00007

Subject: Re: Relacionamentos
Em Qui 07 Out 2004 09:13, Álvaro Vieira escreveu:
> Pessoal, tenho as tabelas Cliente e Avalista ligadas à Pessoa, como abaixo.
>
> -----------------
> Pessoa
> -----------------
> pessoa_id (pk)
> nome
> ...
> -----------------
>
> -----------------
> Cliente
> -----------------
> pessoa_id (pk/fk)
> dt_nascimento
> ...
> -----------------
>
> -----------------
> Avalista
> -----------------
> pessoa_id (pk/fk)
> ...
> -----------------
>
> Como um Cliente pode ter um ou vários Avalistas, preciso ligar estas
> duas tabelas, sendo assim, pensei em criar uma fk em Avalista ligando-a
> à Cliente. Está correto ou existe outra forma melhor?

No mundo real, seria um relacionamento muitos a muitos, uma pessoa tem vários 
avalistas, e pode avalizar muitas outras (ainda que não ao mesmo tempo), 
então você deverá incluir uma referência ao contrato/movimento a que se 
refere esse aval.

----------
Avalista
----------
pessoa_id (fk)
avalista_id (fk)
contrato (fk)
--algo mais (data, situacao...)???

pk(pessoa_id, avalista_id, contrato)
-- 
johnny - LUN 157066 - johnny-H2hjhS7PiucJBBnbVQ8SfA@xxxxxxxxxxxxxxxx
icq: 195352192
Murphy era um otimista.


mail do grupo 

Enviar mensagem: bancosdedados-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx
Assinar: 
bancosdedados-subscribe-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx
Cancelar assinatura: 
bancosdedados-unsubscribe-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx
Proprietário da lista: 
bancosdedados-owner-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx
 
Links do Yahoo! Grupos

<*> Para visitar o site do seu grupo na web, acesse:
    http://br.groups.yahoo.com/group/bancosdedados/

<*> Para sair deste grupo, envie um e-mail para:
    bancosdedados-unsubscribe-EYaqaC9dFX8MqA7zqLjoiV/I71DsQ//L@xxxxxxxxxxxxxxxx

<*> O uso que você faz do Yahoo! Grupos está sujeito aos:
    http://br.yahoo.com/info/utos.html

 






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe