Appendix B. The Quotient: An Additional Operation of the Relational Algebra
The quotient of two tables is not used often, but has a very specific use. It arises when we wish to select those rows of a table that are sufficient to provide all possible values in certain columns. As an example, imagine a business that makes furniture. The database for this business has a table on the types of wood that they use and on suppliers of wood and which types they supply. Examples are shown in Table 2.1 and Table 2.2 (of course, these tables would include more columns, but this is just to illustrate the point):
Table B-1. WOOD
|
Type |
|---|
|
Mahogany |
|
Red oak |
|
Poplar |
|
Walnut |
Table B-2. SUPPLIER/TYPE
|
Sname |
Type |
|---|---|
|
Jones Wood Supply |
mahogany |
|
Austin Hardwoods |
red oak |
|
Orange Coast |
mahogany |
|
Jones Wood Supply |
poplar |
|
West Lumber |
poplar |
|
Jones Wood Supply |
walnut |
|
Austin Hardwoods |
walnut |
|
Jones Wood Supply |
red oak |
|
Orange Coast |
walnut |
|
West Lumber |
red oak |
|
Orange Coast |
poplar |
|
Orange Coast |
red oak |
|
Fred’s Woods |
walnut |
Note that there are four types of wood. Suppose we want to know which suppliers supply all four types—a reasonable question. The answer, which is shown in Table 2.3, is called the quotient.
Table B-3. SUPPLIER/TYPE WOOD
|
Sname |
|---|
|
Jones Wood Supply |
|
Orange Coast |
and is called the quotient of the table SUPPLIERS/TYPE by WOOD, written SUPPLIER/TYPE ÷ WOOD.
As you can see, the quotient can certainly come up in real-life situations. The reason for defining a specific operation for this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access