Set difference, Database Management System

Set Difference

If R1 and R2 are two union compatible relations or relations then result of R3 =R1- R2 is the relation that have only those tuples that are in R1 but not in R2.

Incase, R3 will have tuples such that R3 = {t | R1 ∋ t ∧ t∉R2}.

 

Example:

 

R1

 

X

Y

A1

B1

A7

B7

A2

B2

A4

B4

 

 

 

  R2  

A

B

A1

B1

A2

B2

A3

B3

A4

B4

 

 

R1-R2 =

 

 

 

R1-R2 =

A

B

A3

B3

 

R2-R1=

 

 

 

R2-R1=

A

B

A7

B7

 

 

 

Note: -1) Difference operation is not commutative, i.e.,

 R1 - R2 ≠ R2 - R1

2) Difference operation is not associative, i. e.,

R1 - (R2 - R3) ≠ (R1 - R2) - R3

Posted Date: 3/6/2013 5:46:06 AM | Location : United States







Related Discussions:- Set difference, Assignment Help, Ask Question on Set difference, Get Answer, Expert's Help, Set difference Discussions

Write discussion on Set difference
Your posts are moderated
Related Questions

Give Concurrent sub states diagram for the classroom and exam held. In Figure, simultaneous substrates have been taken. After passing Minor 1 test you could give Minor 2 test. T

For your chosen project, you need to identify the current problem that you wish your project to solve.  Produce a Problem Statement.  The Problem Statement should explain the purpo

What's the difference between a primary key and a unique key? Both primary key and unique key enforces uniqueness of the column on which they are explained. But by default prim

What is banker's algorithm?  Banker's algorithm is a deadlock avoidance algorithm that is applicable to a resource-allocation system with multiple instances of each resource ty

Explain the term- Query. Queries are used to repossess and show specific records in a table. They can also be used to show specific fields of specific records, which meet the co

Explain the B + tree? B + tree is a type of tree which denotes sorted data in a way that permits for efficient insertion, retrieval and removal of records, each of which is

Consider the subsequent relations for a database which keeps track of business trips of salespersons in a sales office: SALESPERSON (SSN, Name, start_year, Dept_no) TRIP (SSN, Fr

What are domain constraints?  A  domain is  a  set  of  values  that  might  be  assigned to an attribute  .all  values that appear in a  column of a relation must be taken fro

A database for the Service and Maintenance (SM) section of a Computer sales and service Company has to be developed. SM gives after sales service to customers. SM branch has a numb