database - Equijoin when used on relations with attributes of same name -
i came across question has been bugging me bit.
if equijoin used 2 relations have multiple attributes of same name, multiple value matches, result? example, consider like:
r(a,b,c,d) , s(c,d,e,f).
if apply equijoin above follows:
r (equi-join)(condition: r.c = s.c) s, how resulting relation behave? interested common 'd' attribute of both relations , presence in result.
many in advance answers!
this should answer question:
table addresses
first_name last_name address john miller 5 miller street jane smith 6 smith way jane becker 7 becker street
table jobs
first_name last_name job john miller milkman jane smith software engineer jane becker translator
query
select * addresses inner join jobs on jobs.first_name = addresses.first_name
result
first_name last_name address job john miller 5 miller street milkman jane smith 6 smith way software engineer jane smith 6 smith way translator jane becker 7 becker street software engineer jane becker 7 becker street translator
as don't join both first name , last name, first name only, join records don't belong together.
Comments
Post a Comment