PL/SQL Inner Join

The PL/SQL INNER JOIN return rows when there is at least one match in the tables.

Phones table

PHONE_IDPHONE_NAMEBRAND_ID
1Galaxy Note Edge1
2N910 Galaxy Note 41
3Galaxy S5 Duos 4G1
4iPhone 5S2
5iPhone 6 Plus2
6930 Lumia3
7830 Lumia3

Phone_brand table

BRAND_IDNAME
1Samsung
2Apple
3Nokia
4HTC
5BlackBerry

Inner Join example

 
SELECT p.phone_id, b.name as brand, p.phone_name
FROM phones p, phone_brands b
WHERE p.brand_id=b.brand_id
ORDER BY p.phone_id;

Output

PHONE_IDBRANDPHONE_NAME
1SamsungGalaxy Note Edge
2SamsungN910 Galaxy Note 4
3SamsungGalaxy S5 Duos 4G
4AppleiPhone 5S
5AppleiPhone 6 Plus
6Nokia930 Lumia
7Nokia830 Lumia