title: Join two tables with null values - SQL
body: <p>I have two tables as below. I want to join these two for the date 2/04/2021 as like in the output table.
  There are chance to get null values for any of the table as shown in the output.</p>
  <p>student_details</p>
  <pre><code>Auto_id    StudentID    StudentName         LastAttendedDate
  1            AAA          RAGHAV           8/25/2020 1:40:35 AM
  2            BBB          VARUN            2/04/2021 5:40:23 AM
  3            AAA          RAGHAV           2/04/2021 1:40:25 AM
  4            AAA          RAGHAV           2/04/2021 3:40:35 AM
  5            BBB          VARUN            10/01/2021 9:40:35 AM
  6            CCC          MAYA             2/04/2021 8:40:35 AM
  </code></pre>
  <p>exam_details</p>
  <pre><code>Auto_id   StudentID      exam_name          exam_date  
  1            AAA          PRILIMS          2/04/2021 1:40:35 AM 
  2            BBB          MAINS            2/04/2021 5:40:35 AM
  3            AAA          PRILIMS          2/04/2021 8:40:35 AM 
  4            GGG          PRILIMS          2/04/2021 1:10:35 AM 
  5            GGG          MAINS            2/04/2021 2:10:35 AM 
  6            GGG          MAINS            2/05/2021 2:10:35 AM 
  </code></pre>
  <p>Output</p>
  <pre><code>StudentID        LastAttendedDate          exam_name      exam_date          
    BBB          2/04/2021 5:40:23 AM         MAINS        2/04/2021 5:40:35 AM
    AAA          2/04/2021 1:40:25 AM         PRILIMS      2/04/2021 8:40:35 AM
    AAA          2/04/2021 3:40:35 AM         MAINS        2/04/2021 8:40:35 AM
    CCC          2/04/2021 8:40:35 AM          NULL          NULL
    GGG              NULL                      MAINS       2/04/2021 2:10:35 AM 
  </code></pre>
  <ul>
  <li>Should list the StudentID and LastAttendedDate from the table 'student_details' on the date 2/04/2021,</li>
  <li>max(exam_date)(On the date 2/04/2021)  of student  should join to the rows if have.</li>
  <li>Even if no data on the 'student_details' it should show max(exam_date) of student.</li>
  </ul>