Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 17 Consider the following simplified friends relational schema: 1. person name, address); friends (name1,name2): where the second relation stores the information about friends (ie.,
QUESTION 17 Consider the following simplified friends relational schema: 1. person name, address); friends (name1,name2): where the second relation stores the information about friends (ie., name1 and name2 are friends). Assume that this is symmetric relationship, and if X and Y are friends, then the second relation contains two tuples (X, Y), and (Y, X) Now consider this query: select name from person p where exists (select from friends r, person p2 where r.name1 p.name and p2.name r.name2 and p.address p2.address) Which of the following queries gives the same result as the above query? select distinct name from person p, friends r, per where r.name1- p.name and p2.name- r.name2 and p.address - p2.address select distinct name from person p where p.name in (select p2.name son p2 from person p2, friends r where r.name2 - p2.name and r.namel p.name and p.address - p2.address) select distinct name om person p where p.address - (select p2.address from person p2, friends where r.name2 - p2.name and r.namel- p.name) select distinct name from person p where not unique (select* from person p2, friends r where r.name2- p2.name and r.namel- p.name and p.address - p2.address)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started