Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 5th, 2002, 01:59 PM
TheMike TheMike is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Posts: 6 TheMike User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question DB Nomalization question

I'm having a little problem with the normalization of the db I'm trying to setup for my website. (for a tradinghouse)
I have two entities Product (product data) and Contact (a table of company data (name, phone, address etc) of customers, supplier etc.))
One Product attribute is supplierID and another eventually customerID so that means two relations between the two tables.
I can even think of a third relation namely locationID (location of product)
How do you describe such a relation (1 to many) or (many to many) or just 3 (1 to many) relations.
I don't know enough of this normalization theory maybe there is someone around that can help me a bit.

Regards TheMike

Reply With Quote
  #2  
Old June 5th, 2002, 06:02 PM
PabstER PabstER is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 26 PabstER User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Well a one-to-one relationship is the typical primary to foreign key link. One-to-many infers that one field is related to multiple tables, for example, like this:

people
________
personId
name
age

groups
________
groupId
groupName
personId

groupMembers
___________
gmId
groupId
personId

IN the tables above, the personId table has a one-to-many relationship because its personId field ties it in with the groups table. Its personId field ties it with the groupsMembers table also.

If you're interested in learning more about database normalization then see these links:

http://www.wdvl.com/Authoring/DB/Normalization/
http://www.phpbuilder.com/columns/barry20000731.php3
http://www.swynk.com/friends/faour/databasedesign1.asp

Reply With Quote
  #3  
Old June 7th, 2002, 08:42 AM
sylow sylow is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Alkmaar, Netherlands
Posts: 11 sylow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sylow
Quote:
groups
________
groupId
groupName
personId


personId does not belong to this table. It is clearly just a typo

Reply With Quote
  #4  
Old June 7th, 2002, 11:50 AM
dgibson dgibson is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66 dgibson User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
The links arew good, but the example is more confusing than good between the typo (sylow noticed) and bad info. People and Groups clearly have a MANY to MANY relationship via an intermediary table (to which they have one to many relationship). This is good normalization of a many to many but just not labelled properly. One to many is not indicative of the number of tables linked, but the number of related records in the other table to which the relationship is referring.

From the description of the problem itself, I couldn't clearly answer the question at hand either... Just wanted to caution on the previous info in the thread.

Reply With Quote
  #5  
Old June 12th, 2002, 08:32 AM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
1 to 1 is
PK to PK

1 to many is
PK to FK

many to many is
Pk to Linking Tables's FK and
Linking Tables's FK to PK
(has 3 tables)

so

Table 1 | Table 2 | Table 3
ID1 ->>> ID1
ID2 ->>> ID2

Table 2 is the linking table
__________________
Regards,

James Yang
.NET Developer / Network Engineer
MCSE, MCDBA, MCSA, CCNA

http://www.yellowpin.com/
http://www.opentechsupport.com/

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > DB Nomalization question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway