title: Getting results from two different tables using a join
body: <p>Let's say I have the following tables:</p>
  
  <pre><code>+-------------------------------------------+
  | t_classroom                               |
  +-------------------------------------------+
  | PK | id                                   |
  |    | admin_user_id                        |
  |    | name                                 |
  |    | students                             |
  +-------------------------------------------+
  
  +-------------------------------------------+
  | t_shared                                  |
  +-------------------------------------------+
  |    | admin_user_id                        |
  |    | classroom_id                         |
  |    | expiry                               |
  +-------------------------------------------+
  </code></pre>
  
  <p>I want to write a query that will pull all classrooms that an <code>admin_user_id</code> has access to. In essence, I want a union of classroom rows when I search by <code>admin_user_id</code> in the <code>t_classroom</code> table as well as classroom rows when I search by <code>admin_user_id</code> in the <code>t_shared</code> table. I made the following attempt:</p>
  
  <pre><code>  SELECT
      id,
      admin_user_id,
      name,
      students
    FROM
      t_classroom
    WHERE
      admin_user_id = 1
    UNION ALL
    SELECT
      c.id,
      c.admin_user_id,
      c.name,
      students
    FROM
      t_classroom c
      INNER JOIN t_shared s 
      ON c.id = s.classroom_id
    WHERE
      admin_user_id = 1
  </code></pre>
  
  <p>Does the above look correct? Is there anything more efficient/cleaner?</p>