title: SQL Query: How to get data from three different tables
body: <p>I am using mysql and here is the schema that I have.</p>
  
  <p>First Table: <code>Domains</code></p>
  
  <pre><code>+-----------+--------------------+---------------+
  | domain_id | domain_name        | campaign_name |
  +-----------+--------------------+---------------+
  |        1  | test.org           | campaign 1    |
  |        2  | example.org        | campaign 2    |
  +-----------+--------------------+---------------+
  </code></pre>
  
  <p>Second Table: <code>Users</code></p>
  
  <pre><code>+---------+-----------------+---------------+
  | user_id | first_ame       | last_name     |
  +---------+-----------------+---------------+
  |       1 | John            | Zimmer        |
  |       2 | Brian           | Roberts       |
  |       3 | Jon             | McNeill       |
  |       4 | Chris           | Lambert       |
  |       5 | Vipul           | Patel         |
  |       6 | Logan           | Green         |
  +---------+-----------------+---------------+
  </code></pre>
  
  <p>Third Table: <code>Emails</code></p>
  
  <pre><code>+----------+----------------------------------+-----------+---------+
  | email_id | email                            | domain_id | user_id |
  +----------+----------------------------------+-----------+---------+
  |      1   | b1@test.org                      |        1  |      2  |
  |      2   | b2@test.org                      |        1  |      1  |
  |      3   | a1@example.org                   |        2  |      2  |
  |      4   | a2@example.org                   |        2  |      3  |
  |      5   | a3@example.org                   |        2  |      3  |
  |      6   | a4@example.org                   |        2  |      4  |
  +----------+----------------------------------+-----------+---------+
  </code></pre>
  
  <p>I want to get <code>first_name, last_name and email of specific campaign</code> i-e campaign 2 as shown follow.</p>
  
  <p><a href="https://i.stack.imgur.com/SlBUE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SlBUE.png" alt="enter image description here"></a></p>
  
  <p>Here is <a href="https://www.db-fiddle.com/f/43crqdUupUqd357RbX7tcx/1" rel="nofollow noreferrer">Online DB Query Editor</a></p>
  
  <p>Kindly guide me how can I write SQL query to accomplish that. Thanks</p>