Question: Implement the INTERSECT operator. intersect ( relation _ one, relation _ two ) Performs intersection on two relations Parameters: relation _ one: Table Object, one

Implement the INTERSECT operator.
intersect (relation_one, relation_two)
Performs intersection on two relations
Parameters:
relation_one: Table Object, one relation for intersect
relation_two: Table Object, the other relation for intersect
Returns:
Table Object, the intersection of the two relations
Make sure both relations share the same attributes. Otherwise, print error message "relation_one and relation_two does not have same schema!" and return None.
Intersect operator function should return distinct records.
DO NOT use pandas methods to construct operator function. You can use:
python's list/dictionary manipulation
the utility functions provided above
other relational operators implemented in this notebook

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!