title: Denormalising mysql tables for google bigquery
body: <p>I have following schema in Mysql(simplified for this question. In real it contains more tables than given here)</p>
  
  <p><strong>User</strong>: <code>id, email, first_name, last_name, gender, birthday</code> and 30 more such columns</p>
  
  <p><strong>Account</strong>: <code>id, user_id, total_visits, total_credits, total_redemptions, total_debits, points, initial_credit, initial_debit</code> &amp; 20 more such columns</p>
  
  <p><strong>Checkin</strong>: <code>id, user_id, location_id, approved, amount, number, checkin_date, status, qr_code, barcode, points_earned</code> and 30more such columns.</p>
  
  <p>Here</p>
  
  <ol>
  <li>id - primary key. integer </li>
  <li>table_id - foreign key. for example user_id in accounts, table points to user's id col in User table.</li>
  </ol>
  
  <p>To import this, <a href="https://cloud.google.com/bigquery/preparing-data-for-bigquery#denormalizingdata" rel="nofollow"> advice in the docs</a>, is:</p>
  
  <blockquote>
    <p>In BigQuery, you typically want to denormalize the data structure in order to enable super-fast querying. While JOINs on small datasets are possible with BigQuery, they're not as performant as a denormalized structure.Some type of normalization is possible with the nested/repeated functionality.</p>
  </blockquote>
  
  <p>If I understand this, does that mean:</p>
  
  <ol>
  <li>there will only table: User with 100+columsn(data from all these tables(Account, Checkin etc)</li>
  <li>there will be One User table and One Events tables. User datable will have pretty same schema it currently has in mysql. events table will store actual data checkins, account. </li>
  <li>Some Other type of schema?</li>
  </ol>
  
  <p>Further, we can I find more resources that go indepth on denormalising mysql tables for Bigquery? </p>