Chapter 3. B

bag Very loosely, a "set" that permits duplicates; more precisely, a collection of objects, called elements, in which the same element can appear any number of times. An example is the collection (y,y,x,z,y,z), which can equivalently be written as (x,y,y,y,z,z), since bags, like sets, have no ordering to their elements. The number of times a given element appears in a given bag is the multiplicity (of that element with respect to that bag).

The set theory operations of inclusion, union, intersection, difference, and product (but not complement) can all be generalized to apply to bags. First, inclusion: Let b1 and b2 be bags, and let element x appear exactly n1 times in b1 and exactly n2 times in b2 (n1 0, n2 0). Then bag b1 includes ...

Get The Relational Database Dictionary, Extended Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.