<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h2 class="title">
      <a name="other-vendor-data-types">
      </a>
      13.9 Using Data Types from Other Database Engines
     </h2>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045210375504">
  </a>
  <a class="indexterm" name="idm46045210374048">
  </a>
  <a class="indexterm" name="idm46045210372560">
  </a>
  <a class="indexterm" name="idm46045210371072">
  </a>
  <a class="indexterm" name="idm46045210369584">
  </a>
  <p>
   To facilitate the use of code written for SQL implementations from
      other vendors, MySQL maps data types as shown in the following
      table. These mappings make it easier to import table definitions
      from other database systems into MySQL.
  </p>
  <div class="informaltable">
   <table summary="Mapping of MySQL data types to data types from other vendors.">
    <colgroup>
     <col style="width: 35%"/>
     <col style="width: 55%"/>
    </colgroup>
    <thead>
     <tr>
      <th>
       Other Vendor Type
      </th>
      <th>
       MySQL Type
      </th>
     </tr>
    </thead>
    <tbody>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         BOOL
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         TINYINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         BOOLEAN
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         TINYINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <code class="literal">
        CHARACTER VARYING(
        <em class="replaceable">
         <code>
          M
         </code>
        </em>
        )
       </code>
      </td>
      <td>
       <code class="literal">
        VARCHAR(
        <em class="replaceable">
         <code>
          M
         </code>
        </em>
        )
       </code>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
        <code class="literal">
         FIXED
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
        <code class="literal">
         DECIMAL
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
        <code class="literal">
         FLOAT4
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
        <code class="literal">
         FLOAT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
        <code class="literal">
         FLOAT8
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="floating-point-types.html" title="13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE">
        <code class="literal">
         DOUBLE
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         INT1
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         TINYINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         INT2
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         SMALLINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         INT3
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         MEDIUMINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         INT4
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         INT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <code class="literal">
        INT8
       </code>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         BIGINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <code class="literal">
        LONG VARBINARY
       </code>
      </td>
      <td>
       <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
        <code class="literal">
         MEDIUMBLOB
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <code class="literal">
        LONG VARCHAR
       </code>
      </td>
      <td>
       <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
        <code class="literal">
         MEDIUMTEXT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <code class="literal">
        LONG
       </code>
      </td>
      <td>
       <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
        <code class="literal">
         MEDIUMTEXT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         MIDDLEINT
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
        <code class="literal">
         MEDIUMINT
        </code>
       </a>
      </td>
     </tr>
     <tr>
      <td>
       <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
        <code class="literal">
         NUMERIC
        </code>
       </a>
      </td>
      <td>
       <a class="link" href="fixed-point-types.html" title="13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC">
        <code class="literal">
         DECIMAL
        </code>
       </a>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
  <div class="informaltable">
   <table cellpadding="0" cellspacing="0" style="position: fixed; top: 0px; display: none; left: 401px; width: 490px;">
    <thead>
     <tr>
      <th style="width: 190.125px;">
       Other Vendor Type
      </th>
      <th style="width: 298.797px;">
       MySQL Type
      </th>
     </tr>
    </thead>
   </table>
  </div>
  <p>
   Data type mapping occurs at table creation time, after which the
      original type specifications are discarded. If you create a table
      with types used by other vendors and then issue a
   <code class="literal">
    DESCRIBE
    <em class="replaceable">
     <code>
      tbl_name
     </code>
    </em>
   </code>
   statement, MySQL reports the table structure using the equivalent
      MySQL types. For example:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa34805913"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t <span class="token punctuation">(</span>a <span class="token datatype">BOOL</span><span class="token punctuation">,</span> b <span class="token keyword">FLOAT8</span><span class="token punctuation">,</span> c <span class="token keyword">LONG</span> <span class="token datatype">VARCHAR</span><span class="token punctuation">,</span> d <span class="token datatype">NUMERIC</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token output">Query OK, 0 rows affected (0.00 sec)</span>

<span class="token prompt">mysql&gt;</span> <span class="token keyword">DESCRIBE</span> t<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> Field <span class="token punctuation">|</span> Type          <span class="token punctuation">|</span> Null <span class="token punctuation">|</span> Key <span class="token punctuation">|</span> Default <span class="token punctuation">|</span> Extra <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> a     <span class="token punctuation">|</span> tinyint(1)    <span class="token punctuation">|</span> YES  <span class="token punctuation">|</span>     <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span>       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> b     <span class="token punctuation">|</span> double        <span class="token punctuation">|</span> YES  <span class="token punctuation">|</span>     <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span>       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> c     <span class="token punctuation">|</span> mediumtext    <span class="token punctuation">|</span> YES  <span class="token punctuation">|</span>     <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span>       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> d     <span class="token punctuation">|</span> decimal(10,0) <span class="token punctuation">|</span> YES  <span class="token punctuation">|</span>     <span class="token punctuation">|</span> NULL    <span class="token punctuation">|</span>       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output">4 rows in set (0.01 sec)</span></code></pre>
  </div>
 </div>
 <br/>
</div>
