Release 10.1A: OpenEdge Getting Started:
Database Essentials

> ## Many-to-many relationship

> A many-to-many relationship exists when a row in one table has many related rows in a second table. Likewise, those related rows have many rows in the first table. Figure 2–4 shows some examples: an order can contain many items, and an item can appear in many different orders; an employee can work on many projects, and a project can have many employees working on it.

> Figure 2–4: Examples of the many-to-many relationship

> Accessing information in tables with a many-to-many relationship is difficult and time consuming. For efficient processing, you can convert the many-to-many relationship tables into two one-to-many relationships by connecting these two tables with a cross-reference table that contains the related columns.

> For example, to establish a one-to-many relationship between Order and Item tables, create a cross-reference table Order-Line, as shown in Figure 2–5. The Order-Line table contains both the Order Number and the Item Number. Without this table, you would have to store repetitive information or create multiple columns in both the Order and Item tables.

> Figure 2–5: Using a cross-reference table to relate Order and Item tables

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095