title: Magento - Create database view
body: <p>Table could be created like this:</p>
  
  <pre><code>&lt;?php 
  $installer = $this; 
  $installer-&gt;startSetup();
  $installer-&gt;run("
  DROP TABLE IF EXISTS {$this-&gt;getTable('sample_table')};
  CREATE TABLE IF NOT EXISTS {$this -&gt; getTable ('sample_table')} (`id` INT (10) UNSIGNED NOT NULL COMMENT 'primary key', `name` INT (10) NULL COMMENT 'name')
  ");
  $installer-&gt;endSetup();
  </code></pre>
  
  <p>But I have no idea how to create a database view in the above way, which looks like:</p>
  
  <pre><code>CREATE VIEW SAMPLE_VIEW AS 
  SELECT A.NAME, B.NAME FROM TABLE_A A
  INNER JOIN TABLE_B B ON A.FIELD_1 = B.FIELD_1;
  </code></pre>
  
  <p>Any way to do that?</p>