Table Relationships

Table relationships are indispensable to sound data management in applications. Table relationships are virtually the cornerstone of contemporary database practice, and database applications that do not make use of them are either rudimentary or of very specialized purpose.

DataFlex's relational capabilities begin with its ability to have multiple database tables open for add, change, and delete concurrently. By itself, this would be sufficient to enable you to create and maintain table relationships. However, DataFlex further supports relationships through provisions in table definitions, and a number of relational commands such as relate and attach. See Finding Records for more information.

The best way to make full use of DataFlex's relational capabilities is to model thoughtfully the data flows you wish to automate. This requires insight and understanding when converting from manual systems, and perhaps even more when converting from automated systems of nonrelational design.

DataFlex's relational mechanism is inherently hierarchical—that is, it supports many-to-one relationships. This means that, in two related tables, many records in one table may relate to each record in the other table. This also means that a record in the "many" tables may relate to only one record in the "one" table. This is referred to as a "many-to-one" relationship.

In this manual, the "many" table and its records are called the child, and the "one" table and its records are called the parent. Although a record in a child table can relate to only one record in a given parent table, there is theoretically no limit on the number of parent tables a child table might have (nor to the number of child tables a parent might have). The same record in a child table could relate to one record in each of five parent tables, if desired. Such arrangements are not unusual.

Parent tables can have parents of their own, and child table can have children. While child and parent refer to the proximate generation, the terms descendent and ancestor are used to refer to tables removed from the reference table by an indeterminate number of generations.

See Also

Mechanics of Relationships

Using Table Relationships

Database Essentials