3,122 views
0 0 votes

Given the following relations

Vehicle(reg_no,make,colour)

Person(eno,name,address)

Owner(eno,reg_no)

List the names of persons who own only Maruti Cars.

 

So, in person relation there may be three types of people

(1)Person who don’t own any car

(2)Person Who own only Mutiple cars of different make.

(3)Persons who own only Maruti Cars.

So, I have to select only 3rd Type of person from person relation.

I do following set of computations

(1)$T_1\leftarrow \pi _{eno}(vehicle \bowtie_{make \neq Maruti} Owner)$ // Now T1 contains all eno of person who own a non-Maruti car.

(2)$T_2 \leftarrow \pi_{eno}(Owner)-T_1$ //Now T2 will contain eno of all those people who own only Maruti Car

(3)$\pi_{name}(Person \bowtie T_2)$ //Now this shall give me names of persons who own only Maruti Cars.

Am I correct?

 

1 Answer

0 0 votes
$\pi_{\text{name}} $ (  $\sigma_{\text{make}=maruti}$ ( vehicle $\bowtie$ person $\bowtie$ owner )) – $\pi_{\text{name}} $ (  $\sigma_{\text{make} \neq maruti}$ ( vehicle $\bowtie$ person $\bowtie$ owner )) this is correct

$\pi_{\text{name}} $ (  $\sigma_{\text{make}=maruti}$ ( vehicle $\bowtie$ person $\bowtie$ owner )) this is not correct
Position:
Show:

Related questions

1 1 vote
1 1 answer
2.0k
2.0k views
Ashutosh_17 asked Mar 30, 2023
2,036 views
Let R be a relation of degree 5 then the total number of projections possible on R is ___?
0 0 votes
1 1 answer
181
181 views
GO Classes asked Sep 25
181 views
Consider $\mathrm{Flights}(\mathrm{num},\mathrm{src},\mathrm{dst})$, where each tuple represents a directed flight from $\mathrm{src}$ to $\mathrm{dst}$.Let $\mathrm{F}_1...
0 0 votes
1 1 answer
128
128 views
GO Classes asked Sep 25
128 views
Consider $\mathrm{Employee}(\mathrm{eid},\mathrm{name},\mathrm{salary})$, $\mathrm{Project}(\mathrm{pid},\mathrm{title},\mathrm{budget})$, and $\mathrm{WorksOn}(\mathrm{e...
2 2 votes
1 1 answer
118
118 views
GO Classes asked Sep 25
118 views
Consider $\mathrm{Locations}(\mathrm{locationid},\mathrm{name},\mathrm{state},\mathrm{altitude})$$\mathrm{TreeCoverage}(\mathrm{locationid},\mathrm{treetype},\mathrm{year...