Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Relational Model Pratt & Adamski, Chapter 2. Relational Algebra zProject zSelect zJoin z Union z Intersect z Subtract z Product z Division.

Similar presentations


Presentation on theme: "The Relational Model Pratt & Adamski, Chapter 2. Relational Algebra zProject zSelect zJoin z Union z Intersect z Subtract z Product z Division."— Presentation transcript:

1 The Relational Model Pratt & Adamski, Chapter 2

2 Relational Algebra zProject zSelect zJoin z Union z Intersect z Subtract z Product z Division

3 Relational Database zBased in formal set theory zMost common data structure zProvable design principles

4 Relational Definition zRelations zAttributes zRelationships zOperations

5 Relation Attributes Occurrences or Tuples

6 Relation Requirements zAttributes are single valued, and all entries have the same data type zEach attribute has a distinct name zAll values in a column are values of the same attribute zThe order of columns is irrelevant zEach row is distinct zThe order of rows is irrelevant

7 Premiere Products Example

8 Row Operations: Select, Project, Join zSELECT returns desired rows zPROJECT returns desired columns zJOIN creates one table from two by matching specified column values in the two tables

9 Set Operations: Union, Intersection, Difference Returns the union, intersection, or difference of rows in two tables Note: both tables must be “union compatible.” They must have the same number of columns and the corresponding columns must have the same data types.

10 Table Operations: Product, Division zPRODUCT (Cartesian product) produces a table with the columns of both tables and rows consisting of all combinations of rows from the two tables. If table A has m rows and table B has n rows, the product will have m*n rows. zDIVISION (A divided by B where the columns in B are also in A) produces a table consisting of columns in A that are not in B and match all the rows in B.


Download ppt "The Relational Model Pratt & Adamski, Chapter 2. Relational Algebra zProject zSelect zJoin z Union z Intersect z Subtract z Product z Division."

Similar presentations


Ads by Google