title: SQL Create a table
body: <pre><code>CST_ID | TRC_TYPE | COLL_TYPE
  2      | SH       |  NO
  4566   | KA       |  WE
  4566   | KA       |  TH
  888    | EF       |  BV
  44     | SC       |  BV    
  44     | SC       |  BV
  44     | KA       |  BV
  </code></pre>
  
  <p>i would like to table 1 to be result in the formation of table 2 such that the cells in TRC_TYPE(Transaction type) and COLL_TYPE(collateral type) become columns with counting how many times they have been performed by the customer without duplication of CST_ID(Customer ID).</p>
  
  <pre><code>CST_ID | SH | KA | EF | SC | NO | WE | TH | BV
  2      | 1  | 0  | 0  | 0  | 1  | 0  | 0  | 0
  4566   | 0  | 2  | 0  | 0  | 0  | 1  | 1  | 0 
  888    | 0  | 0  | 1  | 0  | 0  | 0  | 0  | 1
  44     | 0  | 1  | 0  | 2  | 0  | 0  | 0  | 3  
  </code></pre>
  
  <p>table 2 represents the number of transactions and collaterals performed by a single customer with information taken from table 1.</p>