title: What is reason of LEFT and Right join in SQL
body: <p>For Example: I have two tables </p>
  
  <p>table agent
       <img src="https://i.stack.imgur.com/Ypcu7.jpg" alt="enter image description here"></p>
  
  <p>table application 
         <img src="https://i.stack.imgur.com/adHOL.jpg" alt="enter image description here"></p>
  
  <p>1)</p>
  
  <pre><code>select a.agentID, agent_nm from agent a
  left join application ap on (ap.agentID=a.agentID);
  </code></pre>
  
  <p>I am using Left join in above query and got the result is 
  <img src="https://i.stack.imgur.com/dSX0w.jpg" alt="enter image description here"></p>
  
  <p>2) </p>
  
  <pre><code>select a.agentID, agent_nm from application ap
  right join agent a  on (ap.agentID=a.agentID);
  </code></pre>
  
  <p>And i am using Right join in above query and got the same result as i got from using the Left join. like
  <img src="https://i.stack.imgur.com/WlBpM.jpg" alt="enter image description here"></p>
  
  <p>So my question why are left and right join in mysql. We can retrieve the data with left join only swap the table. So why we are using the right join in our queries. Same way we can achieve target only using the Righ join without using the left join. 
  So what is the reason of Left and Right Join in SQL. Can anyone explain the logic? </p>