Advanced Database Management System - Tutorials and Notes: Find the table that is union compatible with another table

Search Engine

Please visit, subscribe and share 10 Minutes Lectures in Computer Science

Friday, 16 September 2016

Find the table that is union compatible with another table

Find the relation that is UNION compatible with another relation / Union compatibility in Relational Algebra / Set operations compatibility in Relational Algebra


Question:


10. Consider the following relation SAILOR with the given schema;
SAILOR(Sailor_ID:smallint, sailor_name:char(30), DOB:date, Age:int)
Which of the following relations is UNION compatible with SAILOR?

(a) SAILR(Sailor_ID:smallint, s_name:char(25), DOB:date, Age:int, Address:varchar(5))
(b) SAILOR2(S_ID:int, s_name:char(30), DOB:date)
(c) SAILOR3(SID:int, s_name:varchar(20), DOB:date, Age:smallint)
(d) All of the above



Answer:

(c) SAILOR3(SID:int, s_name:varchar(20), DOB:date, Age:smallint)

For set operations U, ∩, and - in relational algebra, the following are the properties must be held by both relations on either side of the operator;
1. The arity of the set operation should be same, ie., the number of attributes should be same in both relations.
2. The attributes should be compatible, ie., the first attribute of left side relation (LSR) and the first attribute of right side relation (RSR) should be compatible, the second attribute of LSR and the second attribute of RSR should be compatible, and so on.
These conditions are TRUE only for C while we perform SAILOR U SAILOR3.

The other relations SAILR and SAILOR2 given in options (a) and (b) respectively are not with correct number of attributes. Hence, there is no Union compatibility







         Previous Question                                                                                Next Question


No comments:

Post a comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents