[DATABASE] Difference between intersect and union

I have two relations namely PROPERTY and LEASE, see the PROPERTYNO attributes returned from PROPERTY and LEASE respectively:
Screenshot 2018-11-30 at 8.30.55 PM
Screenshot 2018-11-30 at 8.31.09 PM

In intersect, tuples which exists in both relations will be displayed removing duplicates.
Screenshot 2018-11-30 at 8.33.54 PM.png

In union, all tuples from property and all tuples from lease will be displayed removing duplicates:
Screenshot 2018-11-30 at 8.35.23 PM.png

Advertisements
This entry was posted in Database and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s