MySQL Basic about relationship

Posted by Roberto on Stack Overflow See other posts from Stack Overflow or by Roberto
Published on 2010-01-25T02:12:31Z Indexed on 2010/04/03 9:03 UTC
Read the original article Hit count: 526

Hi all!

My doubt is about how to treat the follow thing:

I have a system where a user belong to a company, and this user have their clients.

How is the right way to get a list of all company clients and the follow user name??

In the client table where i have a field with the one of this relations:

  • A company_id and user_id field
  • Just company_id field
  • Just user_id field cause user table have the company_id???
  • Something else...

Tkz Roberto

© Stack Overflow or respective owner

Related posts about mysql

Related posts about foreign-key-relationship