Abstract

This chapter discusses several relational algebra operations such as project, join, and product. A projection of a relation is a new relation created by copying one or more the columns from the original relation into a new table. The result table is a projection of the customer relation with the attributes customer_numb, first_name, and last_name. The order of the columns in the result table is based on the order in which the column names appear in the project statement; the order in which they are defined in the source table has no effect on the result. Rows appear in the order in which they are stored in the source table; project does not include sorting or ordering the data in any way. As with all relational algebra operations, duplicate rows are removed. Join is arguably the most useful relational algebra operations because it combines two tables into one, usually via a primary key-foreign key relationship. Unfortunately, a join can also be an enormous drain on database performance. The product operation (the mathematical Cartesian product) makes every possible pairing of rows from two source tables. The product of the tables produces a result table with 300 rows.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call