Let’s say we have two tables with three columns of the same name. Then Natural join will apply join on all these columns and will it use AND operator to combine conditions?
- Actors (FirstName,LastName,CityId,CityName)
- City(CityId,CityName,ProvinceId)
Possible Query with Natural join:
select FirstName,LastName,CityId,CityName from Actors
Natural join City
What will be expected translation of it
select a1.FirstName, a1.LastName,a1.CityId, a1.CityName from Actors as a1
inner join City as c1
on c1.CityId=a1.CityId and c.CityName=a1.CityName
Course: https://www.educative.io/collection/5352985413550080/6335716377231360
Lesson: https://www.educative.io/collection/page/5352985413550080/6335716377231360/6529091323822080