SQL SERVER – Challenge – Puzzle – Why does RIGHT JOIN Exists

I had interesting conversation with the attendees of the my SQL Server Performance Tuning course.

I was asked if LEFT JOIN can do the same task as RIGHT JOIN by reserving the order of the tables in join, why does RIGHT JOIN exists?

The definitions are as following:
Left Join – select all the records from the LEFT table and then pick up any matching records from the RIGHT table  

Right Join – select all the records from the RIGHT table and then pick up any matching records from the LEFT table

Most of us read from LEFT to RIGHT so we are using LEFT join. Do you have any explaination why RIGHT JOIN exists or can you come up with example, where RIGHT JOIN is absolutely required and the task can not be achieved with LEFT JOIN.

Other Puzzles:

SQL SERVER – Puzzle – Challenge – Error While Converting Money to Decimal

SQL SERVER – Challenge – Puzzle – Usage of FAST Hint

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Scripts
Previous Post
SQL SERVER – Puzzle – Challenge – Error While Converting Money to Decimal
Next Post
SQL SERVER – DBA or DBD? – Database Administrator or Database Developer

Related Posts

Leave a Reply