2,516 views
0 votes
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 votes
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

Related questions

0 votes
0 votes
1 answer
1
Ashutosh_17 asked Mar 30, 2023
886 views
Let R be a relation of degree 5 then the total number of projections possible on R is ___?
3 votes
3 votes
1 answer
4
Hirak asked May 25, 2019
2,126 views
In a relational algebra ∩ is not a basic operator, to make it basic only relational operator we should have areX, – X, UU, –