relationships- in databases... (1 Viewer)

kieransgirl

Member
Joined
Oct 13, 2003
Messages
59
can anyone describe the types of relationships to me in laymans terms? one to many, one to one, many to many...
 

Viper

Member
Joined
Aug 17, 2003
Messages
112
Location
Central Coast
Gender
Male
HSC
2003
Well, let me see if i can put it in laymans terms... (i can do when making a database, but its hard to explain....)

One to One:

If one field can have only one unique value (like in a primary ID), and it can only correspond to another unique value, the relationship must be One-to-One.... You get me?

Eg. "Client_ID" related to "Stock_ID".
There can be only one client allocated to each client ID. The same applies for Stock ID.

One-To-Many:

If One unique value can somehow relate to a value that could be multiple values, the relationship should be One-to-Many.

Eg. "Stock_ID" related to "Order_ID"

There can only be one piece of stock allocated to the stock ID, but there can be many pieces of stock related to one particular order... hmm getting confusing?

Many-To-Many:

If a field that can be one of many values relates to another field that can hold many values, the relationship should be Many-To-Many.

Eg. "Order_ID" related to "Payment_ID"

Many orders can be related to many payments (like if the payments are made in installments...)

Im sorry i couldnt make it clearer... It'd be much easier to explain with a schema..

I hope this helps you

Cheers
 

jayk

New Member
Joined
Oct 19, 2003
Messages
27
haha your a legend viper - i knew the types of relationships - but you explained it well - exactly how i would have explained it..
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top