title: Join 3 tables in Yii 2
body: <p>I am working on a Yii 2 project. I have 3 tables:</p>
  
  <p>1) Student Data Table</p>
  
  <ul>
  <li><strong>student_data_id</strong></li>
  <li>last_name</li>
  <li>first_name</li>
  </ul>
  
  <p>2) Student Table</p>
  
  <ul>
  <li><strong>student_id</strong></li>
  <li><strong>student_data_id</strong></li>
  <li>class_id</li>
  </ul>
  
  <p>3) Scores table</p>
  
  <ul>
  <li><strong>student_id</strong></li>
  </ul>
  
  <p>From the scores table, I need to access the name of the student. In other words, I need to retrieve the last and first name of the student from the Student Data table using the <strong>student_id</strong>. I am familiar with joining tables but I don't know how to do this syntactically in Yii2. I hope I am clear and thank you in advance.</p>
  
  <p><strong>Edit</strong>
  I also have 3 models of each table.</p>