3 votes 3 votes Databases made-easy-test-series databases sql + – varun singh asked Feb 6, 2017 edited Mar 5, 2019 by adeebafatima1 varun singh 638 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply varun singh commented Feb 6, 2017 reply Follow Share why 3rd query is right? 0 votes 0 votes prasitamukherjee commented Feb 7, 2017 reply Follow Share i don't think 3rd query is right. It is returning whole R 0 votes 0 votes nikkey123 commented Sep 23, 2017 reply Follow Share i also think 3rd query is not the right answer. but had you seen the solution given by them 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes R − (R − S) = R ∩ S. (SELECT * FROM R) EXCEPT ((SELECT * FROM R) EXCEPT (SELECT * FROM S)); it leads to the 3rd query Debasmita Bhoumik answered Feb 7, 2017 Debasmita Bhoumik comment Share Follow See all 4 Comments See all 4 4 Comments reply varun singh commented Feb 7, 2017 reply Follow Share why R-(R-S) ?,......i think innermost query results in all the tupples of S and therefore outer query of innermost will result in NULL, so outermost query will result in R which is not equivalent to R∩S. 0 votes 0 votes Debasmita Bhoumik commented Feb 8, 2017 reply Follow Share R − (R − S) = R ∩ S this is a verified formula. u can just take some tables as example and check. r-s returns those items who were in r but not common to r and s. so if we subtract from r those points who r not common.. they in result we get the common points –1 votes –1 votes vamp_vaibhav commented Nov 26, 2017 reply Follow Share I think third query is wrong somewhere.. It doesn't lead to R intersection S 0 votes 0 votes Deepalitrapti commented Nov 18, 2018 reply Follow Share How 1 and 2 query right 0 votes 0 votes Please log in or register to add a comment.