0% found this document useful (0 votes)
50 views

Relational Algebra Operations From Set Theory: Cartesian Product (Cross Product or Cross Join)

The document discusses various relational algebra operations including union, intersection, difference, cartesian product, join, and division. It notes that SQL operations include union, intersect, except, union all, intersect all, and except all. It also defines cartesian product as a binary set operation that joins relations without requiring they be union compatible, and explains join combines related tuples from two relations into a single relation with longer tuples through conditions like equijoin using "=" and theta join using comparisons.

Uploaded by

endurthiabhilash
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Relational Algebra Operations From Set Theory: Cartesian Product (Cross Product or Cross Join)

The document discusses various relational algebra operations including union, intersection, difference, cartesian product, join, and division. It notes that SQL operations include union, intersect, except, union all, intersect all, and except all. It also defines cartesian product as a binary set operation that joins relations without requiring they be union compatible, and explains join combines related tuples from two relations into a single relation with longer tuples through conditions like equijoin using "=" and theta join using comparisons.

Uploaded by

endurthiabhilash
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Relational Algebra Operations from Set Theory

UNION, INTERSECTION and MINUS (or SET DIFFERENCE or EXCEPT) RS=((RUS)-(R-S))-(S-R) RUS=SUR and RS=SR RU(SUT)=(RUS)UT and R(ST)=(RS) T R-SS-T SQL operations are UNION, INTERSECT, EXCEPT, UNION ALL, INTERSECT ALL, EXCEPT ALL. All may not be available in all flavors or sqls. CARTESIAN PRODUCT (CROSS PRODUCT or CROSS JOIN) o Denoted by x o Binary set operation o Relations do not have to be union compatible (different r=columns can be joined) o Generally not useful by itself useful when followed by a selection that matches values of attributes. Ex: to select depnedents of female employees, select fname,lname,dependent_name from employee,dependent where employee.sex=F and employee.ssn=dependent.essn; JOIN and DIVISION o JOIN Denoted by Combine related tuples from two relations into single relation with longer tuples. Example DEPT_MGRDEPARTMENT Mgr_ssn=Ssn EMPLOYEE, RESULT Dname,Fname,Lname (DEPT_MGR) JOIN general form R|><| <join condition> S Theta join uses =,>,<, >=, <= and in join conditions Equijoin subset of theta join with condition = Natural join Denoted by *, Removes second (superfluous) attribute in an EQUIJOIN condition. Cross check for employee JOIN SELECTIVITY

You might also like