6.1 Significance of Relational Operators
•
Relational database supports basic database operations in order to provide useful means for retrieving or manipulating data in tables.
•
Because the relational model has its mathematical basis upon the relational theory (by thinking tables as sets or relations), the supported database operators conform to existing operators in relational algebra.
•
In fact, a relational database software implementation, called DBMS, is said to have higher degree of relational completeness depending upon the extent to which relational algebra operators are supported.
•
In total there are eight operators are found in relational theory, namely SELECT,
PROJECT, JOIN, INTERSECT, UNION, DIFFERENCE, PRODUCT and DIVIDE.
•
Minimally speaking, a DBMS implementation is said to be relational if it supports at least the key relational operators, namely SELECT, PROJECT, and JOIN.
•
Very few DBMSs are capable of supporting all eight relational operators.
•
Use of relational algebra operators on existing tables (relations) results in outcomes look like new relations. This characteristic lets the user recursively applying the operators among the operator outcomes. Figure
6.2 Operator: UNION:
• Needs two tables as its operands
• Combines all rows from two tables, excluding duplicate rows.
• Tables, used as operands, must be UNION compatible with each other. (Tables must have the same attribute characteristics for all columns i.e. the columns and domains must be identical).
• Figure-6.1 demonstrates an example of UNION operation.
Popped up Questions
Choose the right answer for the UNION Operation shown in the figure.
6.3 Operator: INTERSECT:
• Needs two tables as its operands
• Yields only the rows that appear in both the tables
• Operand tables must be UNION compatible with each other
• Figure-6.2 demonstrates an example of INTERSECT operation.