Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Como modelar o banco [?]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ralph Effting  
View profile   Translate to Translated (View Original)
 More options Oct 8 2012, 4:13 pm
From: Ralph Effting <ralft...@gmail.com>
Date: Mon, 8 Oct 2012 13:13:22 -0700 (PDT)
Local: Mon, Oct 8 2012 4:13 pm
Subject: Como modelar o banco [?]

Boa tarde galera, estou com uma duvida e não encontro a solução dela.
Bom a duvida é a seguinte:

possuo uma tabela chamada *ENDERECO *ela sera relacionada com a tabela *USUARIOS
*na tabela* ENDERECO *tera os estados ai veio minha duvida, para aplicações
grandes é necessário que os estados existentes estejam em outra tabela? e
nessa tabela ele só busque pela chave estrangeira?  

Tabela *ENDERECO*
*id: 1*
*fk_id_estados: 1*
*nome:*
*..*

Tabela *ESTADOS*
*id:* 1
*nome:* Santa Catarina

*Ou*
cadastro diretamente do sistema o valor em *VARCHAR *mesmo ?

Tabela *ENDERECO*
*id: 1*
*estados:  Santa Catarinha*
*nome:*
*..*


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brunno Henrique  
View profile   Translate to Translated (View Original)
 More options Oct 9 2012, 2:06 pm
From: Brunno Henrique <bhmo...@gmail.com>
Date: Tue, 9 Oct 2012 15:06:38 -0300
Local: Tues, Oct 9 2012 2:06 pm
Subject: Re: Como modelar o banco [?]

boa tarde!

pelo o que eu entendi a dua duvida é o seguinte, eu criaria da seguinte
forma.

TABLE.ENDERECO
ID_END
ID_CIDADE
NOME_END
....
STATUS

TABLE.CIDADE
ID_CIDADE
ID_ESTADO
NOME_CIDADE
STATUS

TABLE.ESTADO
ID_ESTADO
NOME_ESTADO
STATUS

lembrando que atraves do id da cidade vc encontra o estado.

COMO FICARIA A QUERY PARA BUSCAR O NOME DO ESTADO E CIDADE DE UM
DETERMINADO ENDEREÇO.

SELECT
     E.NOME_END,
     C.NOME_CIDADE,
     T.NOME_ESTADO
FROM
     ENDERECO E,
     CIDADE C,
     ESTADO T
WHERE E.ID_CIDADE = C.ID_CIDADE
    AND C.ID_ESTADO = T.ID_ESTADO
ODER BY 2,3,1

espero ter ajudado.

Em 8 de outubro de 2012 17:13, Ralph Effting <ralft...@gmail.com> escreveu:

--

Att.
*Brunno Henrique*
Analista de T.i / Redes
Msn / E-mail: bhmo...@gmail.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ralph Effting  
View profile   Translate to Translated (View Original)
 More options Oct 9 2012, 3:19 pm
From: Ralph Effting <ralft...@gmail.com>
Date: Tue, 9 Oct 2012 16:19:16 -0300
Local: Tues, Oct 9 2012 3:19 pm
Subject: Re: Como modelar o banco [?]

Opa obrigado me deu uma luz aqui sim Brunno obrigado cara! Já sei como
fazer.
*;) *


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »