The Gateway to Computer Science Excellence

+2 votes

+1 vote

in my gate 2019 paper I have got table data bit different compared to this question. when I solved that question I have got answer as 1. for this particular question answer would be zero only. Please check below.

as operation ∧ is commutative, we better find out R.V=V2 first.**σ(P.Y=R.Y ∧ R.V=V2)(P × R)**

**R.V=V2**

Y |
V |

y3 | v2 |

y2 | v2 |

**σ(P.Y=R.Y ∧ R.V=V2)(P × R)**

X |
Y |
Z |
V |

x2 | y2 | z2 | v2 |

x2 | y2 | z4 | v2 |

**∏x(σ(P.Y=R.Y ∧ R.V=V2)(P × R))**

so when we project column x from the above relation we get (i.e : as no relation should contain duplicate elements)

X |

x2 |

similarly for **σ(Q.Y=R.Y ∧ Q.T>2)(Q × R) we get it as below.**

**Q.T>2**

X |
Y |
T |

x1 | y2 | 5 |

x2 | y1 | 6 |

**σ(Q.Y=R.Y ∧ Q.T>2)(Q × R)**

X |
Y |
T |
V |

x1 | y2 | 5 | v3 |

x1 | y2 | 5 | v2 |

x2 | y1 | 6 | v1 |

when we project column x from the above relation we get

X |
---|

x1 |

x2 |

(i.e : as no relation should contain duplicate elements)

**∏x(σ(P.Y=R.Y ∧ R.V=V2)(P × R)) - ∏x(σ(Q.Y=R.Y ∧ Q.T>2)(Q × R))**

the final result is {x2} **- **{x1, x2} it should be nothing

so answer should be **0 **for this question.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,357 answers

198,483 comments

105,255 users