<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-schemata-table">
      </a>
      28.3.31 The INFORMATION_SCHEMA SCHEMATA Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045078775792">
  </a>
  <p>
   A schema is a database, so the
   <a class="link" href="information-schema-schemata-table.html" title="28.3.31 The INFORMATION_SCHEMA SCHEMATA Table">
    <code class="literal">
     SCHEMATA
    </code>
   </a>
   table provides information
      about databases.
  </p>
  <p>
   The
   <a class="link" href="information-schema-schemata-table.html" title="28.3.31 The INFORMATION_SCHEMA SCHEMATA Table">
    <code class="literal">
     SCHEMATA
    </code>
   </a>
   table has these columns:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       CATALOG_NAME
      </code>
     </p>
     <p>
      The name of the catalog to which the schema belongs. This
          value is always
      <code class="literal">
       def
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SCHEMA_NAME
      </code>
     </p>
     <p>
      The name of the schema.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DEFAULT_CHARACTER_SET_NAME
      </code>
     </p>
     <p>
      The schema default character set.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DEFAULT_COLLATION_NAME
      </code>
     </p>
     <p>
      The schema default collation.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       SQL_PATH
      </code>
     </p>
     <p>
      This value is always
      <code class="literal">
       NULL
      </code>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       DEFAULT_ENCRYPTION
      </code>
     </p>
     <p>
      The schema default encryption.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Schema names are also available from the
   <a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
    <code class="literal">
     SHOW
      DATABASES
    </code>
   </a>
   statement. See
   <a class="xref" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
    Section 15.7.7.15, “SHOW DATABASES Statement”
   </a>
   . The following statements are
      equivalent:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa66576438"><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 keyword">SELECT</span> <span class="token keyword">SCHEMA_NAME</span> <span class="token keyword">AS</span> <span class="token punctuation">`</span><span class="token keyword">Database</span><span class="token punctuation">`</span>
  <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>SCHEMATA
  <span class="token punctuation">[</span><span class="token keyword">WHERE</span> <span class="token keyword">SCHEMA_NAME</span> <span class="token operator">LIKE</span> <span class="token string">'<em class="replaceable">wild</em>'</span><span class="token punctuation">]</span>

<span class="token keyword">SHOW</span> <span class="token keyword">DATABASES</span>
  <span class="token punctuation">[</span><span class="token operator">LIKE</span> <span class="token string">'<em class="replaceable">wild</em>'</span><span class="token punctuation">]</span></code></pre>
  </div>
  <p>
   You see only those databases for which you have some kind of
      privilege, unless you have the global
   <a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
    <code class="literal">
     SHOW
      DATABASES
    </code>
   </a>
   privilege.
  </p>
  <div class="caution" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Caution
   </div>
   <p>
    Because any static global privilege is considered a privilege
        for all databases, any static global privilege enables a user to
        see all database names with
    <a class="link" href="show-databases.html" title="15.7.7.15 SHOW DATABASES Statement">
     <code class="literal">
      SHOW
        DATABASES
     </code>
    </a>
    or by examining the
    <a class="link" href="information-schema-schemata-table.html" title="28.3.31 The INFORMATION_SCHEMA SCHEMATA Table">
     <code class="literal">
      SCHEMATA
     </code>
    </a>
    table of
    <code class="literal">
     INFORMATION_SCHEMA
    </code>
    , except databases that
        have been restricted at the database level by partial revokes.
   </p>
  </div>
  <h4>
   <a name="idm46045078747248">
   </a>
   Notes
  </h4>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The
      <a class="link" href="information-schema-schemata-extensions-table.html" title="28.3.32 The INFORMATION_SCHEMA SCHEMATA_EXTENSIONS Table">
       <code class="literal">
        SCHEMATA_EXTENSIONS
       </code>
      </a>
      table
          augments the
      <a class="link" href="information-schema-schemata-table.html" title="28.3.31 The INFORMATION_SCHEMA SCHEMATA Table">
       <code class="literal">
        SCHEMATA
       </code>
      </a>
      table with
          information about schema options.
     </p>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
