+ 1
What are the benefits of creating left and right joins?
benefits of join types
2 Respostas
+ 7
You can use left/right joins to create a query where you get all data from one table plus the data of the other table, where the key condition matches.
For example if you have table Customers and a table VIP, where special informations of customers VIP-memership are stored, you can know use a left join to get all customers with their potential VIP-Data.
Because a customer dont have to be a VIP, with a normal join you only would get all VIP-Customers.
select * from Customers
left join VIP using ( CustomerID)
#you get all customers
select* from Customers
join VIP using ( CustomerID)
#you get only VIPs
+ 3
Left joins and right joins would help when you need to retrieve data records matching with specific criteria from tables with more than 10,000 rows where manual mapping of values would be tedious. It benefits in real time applications like finding banking transactions, mapping friends list with tagged posts in face book and so on.