title: MySQL query to find girls living in same state
body: <p><strong>Que -Find out the female students who belongs to same state.</strong>
  <img src="https://i.stack.imgur.com/cgiye.png" alt="STUDENTS TABLE" /></p>
  <pre><code>SELECT (A.NAME),B.NAME,A.STATE,B.STATE,A.GENDER,B.GENDER.
  FROM STUDENT A
  JOIN STUDENT B 
  ON (A.STATE = B.STATE)AND A.NAME!=B.NAME AND (A.GENDER=B.GENDER) AND A.GENDER =&quot;F&quot;;
  </code></pre>
  <p>As per the above query if person A and B satisfy the condition ,B and A also satisfy ,in such cases , there are two tuples  A-B and B-A ,which are actually not needed ,since A-B is sufficient .</p>
  <p><strong><strong>what modifications do you need to make ?</strong></strong></p>
  <p>thank you.</p>