Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set Relation / 1 to many / 1 to 1
Message
 
 
To
11/06/1999 11:31:54
Coann Teng
Computer Infobase System S/B
Kuala Lumpur, Malaysia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00228817
Message ID:
00228842
Views:
11
>Can anyone teach me how to decide it is 1 to many relation or 1 to 1 relation? how to decide which is parent table and which is child table? izzit only 2 type of relation ship in FoxPro?

1-1 vs 1-many:

The real world decides this for you. A 1 to 1 relationship is when there can NEVER be more than one record relating the two tables. Example: Table of patients only has a 1-1 relationship with the deathinfo table. It is important to note though in a 1-many relationship, the parent table may relate to no records in the child table, 1 record or more than 1 record.

Which is child:

This can change. For instance I have a PATIENT table that is the parent table to a DOCTORS table in one query and in another query the DOCTORS table is the parent and the PATIENT is the child. It depends how you are viewing and logically thinking of the data at the moment.
Previous
Reply
Map
View

Click here to load this message in the networking platform