What are the benefits of creating left and right joins? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What are the benefits of creating left and right joins?

benefits of join types

10th Dec 2016, 11:05 AM
Bria Hinder
2 Answers
+ 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
10th Dec 2016, 12:06 PM
lulugo
lulugo - avatar
+ 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.
12th Dec 2016, 7:43 PM
Sindhuja.R
Sindhuja.R - avatar