SQL Inner Join
An INNER JOIN
returns only the rows that have matching values in both tables. If there are no matches, the rows are excluded from the result set.
Example: Using INNER JOIN
SELECT FreedomFighters.Name, Contributions.Amount, Contributions.ContributionDate
FROM FreedomFighters
INNER JOIN Contributions ON FreedomFighters.FighterID = Contributions.FighterID;
Output:
Name | Amount | ContributionDate |
---|---|---|
Mahatma Gandhi | 1000.00 | 1920-08-15 |
Subhas Chandra Bose | 1500.00 | 1943-07-04 |
Bhagat Singh | 500.00 | 1928-03-23 |
Rani Lakshmi Bai | 800.00 | 1857-06-18 |