<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="information-schema-keywords-table">
      </a>
      28.3.17 The INFORMATION_SCHEMA KEYWORDS Table
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045079533344">
  </a>
  <p>
   The
   <a class="link" href="information-schema-keywords-table.html" title="28.3.17 The INFORMATION_SCHEMA KEYWORDS Table">
    <code class="literal">
     KEYWORDS
    </code>
   </a>
   table lists the words
      considered keywords by MySQL and, for each one, indicates whether
      it is reserved. Reserved keywords may require special treatment in
      some contexts, such as special quoting when used as identifiers
      (see
   <a class="xref" href="keywords.html" title="11.3 Keywords and Reserved Words">
    Section 11.3, “Keywords and Reserved Words”
   </a>
   ). This table provides applications
      a runtime source of MySQL keyword information.
  </p>
  <p>
   The
   <a class="link" href="information-schema-keywords-table.html" title="28.3.17 The INFORMATION_SCHEMA KEYWORDS Table">
    <code class="literal">
     KEYWORDS
    </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">
       WORD
      </code>
     </p>
     <p>
      The keyword.
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       RESERVED
      </code>
     </p>
     <p>
      An integer indicating whether the keyword is reserved (1) or
          nonreserved (0).
     </p>
    </li>
   </ul>
  </div>
  <p>
   These queries lists all keywords, all reserved keywords, and all
      nonreserved keywords, respectively:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa34552608"><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 operator">*</span> <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>KEYWORDS<span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> WORD <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>KEYWORDS <span class="token keyword">WHERE</span> RESERVED <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> WORD <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>KEYWORDS <span class="token keyword">WHERE</span> RESERVED <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   The latter two queries are equivalent to:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa57767059"><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> WORD <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>KEYWORDS <span class="token keyword">WHERE</span> RESERVED<span class="token punctuation">;</span>
<span class="token keyword">SELECT</span> WORD <span class="token keyword">FROM</span> INFORMATION_SCHEMA<span class="token punctuation">.</span>KEYWORDS <span class="token keyword">WHERE</span> <span class="token operator">NOT</span> RESERVED<span class="token punctuation">;</span></code></pre>
  </div>
  <a class="indexterm" name="idm46045079520144">
  </a>
  <a class="indexterm" name="idm46045079519056">
  </a>
  <p>
   If you build MySQL from source, the build process generates a
   <code class="filename">
    keyword_list.h
   </code>
   header file containing an
      array of keywords and their reserved status. This file can be
      found in the
   <code class="filename">
    sql
   </code>
   directory under the build
      directory. This file may be useful for applications that require a
      static source for the keyword list.
  </p>
 </div>
 <br/>
</div>
