title: Creating a new column based on data from an existing column
body: <p>Consider a system to track repairs. I have a table with customer data and a common id key. I have a second table with a column to show which type of repair part was used on each id key and how many were used. Their definitions are below:</p>
  
  <pre><code>order_information
  order_id  |  cust_last_name
  465          Smith
  899          Williams
  512          Johnson
  345          Fenton
  122          Bowles
  944          Cooper
  
  parts_usage
  order_id  |  part_type  |  part_quantity
  465          Part 1        5
  465          Part 2        4
  899          Part 1        2
  899          Part 2        8
  899          Part 3        6
  512          Part 3        1
  345          Part 2        4
  345          Part 3        5
  122          Part 2        3
  944          Part 1        2
  </code></pre>
  
  <p>I'd like to run a query for reporting that will return the part's pieces broken out like so:</p>
  
  <pre><code>order_id  |  Part 1  |  Part 2  |  Part 3  |  Total
  465          5          4                     9
  899          2          8          6          16
  512                                1          1
  345                     4          5          9
  122                     3                     3
  944          2                                2
  </code></pre>
  
  <p>Is it possible to do this with a query so that my reports can show how many of each part was used on each repair ticket? </p>
  
  <p>As you can see, each <code>order_id</code> can have multiple part types and unique quantities. I want to break the different part types (I have 3 total) into 3 separate columns with their totals listed by <code>order_id</code>.</p>