Data Retrieval - 12
Data Retrieval - 12
Data Retrieval
Interview
Q A
..!
es th
ns
wi
tio
in qu
g
ar
Sh ter
oun
C
Krishan kumar
@Krishan kumar
How can you fetch
common records from
two tables?
What is an INNER JOIN?
1 John
2 Alice
3 Bob
TableB:
ID Product
2 Laptop
3 Tablet
Result:
ID Name Product
2 Alice Laptop
3 Bob Tablet
umar
krishan k
1. What happens if there are no
matching records?
If there are no matching values, an INNER JOIN
will return an empty result set.
For example,
ON TableA.ID = TableB.ID
AND TableA.Name = TableB.Name.
ion
st
ue
t Q
x
Ne
4. Can we fetch common records
from more than two tables?
Yes, you can use multiple INNER JOIN clauses
to fetch common records from three or more
tables. Just add another INNER JOIN for each
additional table.
re
mo
nts
wa
Ciku
5. What if the column names are
different in both tables?
You can still join the tables by specifying the
correct column names in the ON clause,
like:
ON TableA.ID_A = TableB.ID_B.
😉
Visit my Linkedin for such amazing Content
krishan kumar