Active TopicsActive Topics  Display List of Forum MembersMemberlist  CalendarCalendar  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
 One Stop GATE ForumGATE AT A GLANCEBasic GATE Info
Message Icon Topic: Databases Post Reply Post New Topic
Author Message
aparna
Groupie
Groupie


Joined: 30Apr2007
Online Status: Offline
Posts: 70
Quote aparna Replybullet Topic: Databases
    Posted: 26Nov2007 at 2:32am
Databases
Consider three tables with following number of tuples in each

S(a,b,c) = 100
R(a,d,e) = 80
T(x,d,f) = 90

Tuples in S and R with same value of attribute "a" = 60
Tuples in R and T with same value of attribute "d" = 70

Maximum and minimum number of tuples in (S left outer join R) full outer join T is:

Options
1. 130 120
2. 150 140
3. 140 130
4. 140 120

Ans: 3

Explanation:
Consider, X = ( S left outer join R ) This will have 100 rows, with d = null for 40(100-60) rows.

X full outer join T: Here, the common values of d in tables X and T can be between 50 and 60.

Case 1: Minimum value of common values of d between X and T
Out of 80 values of d in R, 20 were not found in X (since X has only 60 non-null values of d). These 20 can all be the ones that were common between S and T. In this case the common values between X and T will be 50.

Case 2: Maximum value of common values of d between X and T
Now assume that 20 values of d that were lost, none was common between S and T. But this is not possible, because S has 80 tuples and 70 values are common with T. So at least 10 common values will get lost. Thus max. value of common d's will b 60.

Now full outer join (X + T - common values of d in X and T) will be either
100 + 90 - 50 or 100 + 90 - 60.

Thus the answer is 140,130. Hence 3



Post Resume: Click here to Upload your Resume & Apply for Jobs

IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

GET LATEST FRESHERS JOBS IN YOUR MAIL





This page was generated in 0.063 seconds.
Vyom is an ISO 9001:2000 Certified Organization

© Vyom Technosoft Pvt. Ltd. All Rights Reserved.

Job Interview Questions | Girls Magazine | DLL, OCX File Errors | Freshers Jobs | Placement Papers | More Papers