Click to See Complete Forum and Search --> : Join Explanation
Augury
07-14-2006, 08:57 PM
I have a co-worker who is not a programmer or database guy, and today he came and randomly asked me about joins in an sql based database. I tried to explain about inner joins and he just wasn't grasping it. Do any of you have an idea of how I can explain this or maybe no of a reference I can send him. The problem I have is I think I am assuming too much knowledge.
felgall
07-14-2006, 11:45 PM
An inner join contains the records from both tables where a field or group of fields in one table matches the corresponding field(s) in the other table each matching combination will be output.
For example if table 1 contains
a book
b hair
c dog
and table 2 contains
a fairy
a hat
b money
d cat
then if we do an inner join on the first field from both tables we get
a book fairy
a book hat
b hair money
if instead we do an outer join we will get
a book fairy
a book hat
b hair money
c dog NULL
d NULL cat
the outer join adds records to the join for those entries in each table that don't have matches in the other.