> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# create_table

<div className="kinetica-typedoc">
  <div className="section tsd-panel tsd-member">
    <h3 className="tsd-anchor-link" id="create_table"><span>create\_table</span></h3>

    <ul className="tsd-signatures">
      <li className="">
        <div className="tsd-signature tsd-anchor-link" id="create_table-1"><span className="tsd-kind-call-signature">create\_table</span><span className="tsd-signature-symbol">(</span><br /> <span className="tsd-kind-parameter">table\_name</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">type\_id</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">options</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">Record</span><span className="tsd-signature-symbol">\<</span><span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">></span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">callback</span><span className="tsd-signature-symbol">?:</span> <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a><span className="tsd-signature-symbol">,</span><br /><span className="tsd-signature-symbol">)</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/CreateTableResponse" className="tsd-signature-type tsd-kind-interface">CreateTableResponse</a><span className="tsd-signature-symbol">></span></div>

        <div className="tsd-description">
          <div className="tsd-comment tsd-typography">
            <p>Creates a new table with the given type (definition of columns). The type is specified in <code>type\_id</code> as either a numerical type ID (as returned by <code>create\_type</code>) or as a list of columns, each specified as a list of the column name, data type, and any column attributes.</p>
            <p>Example of a type definition with some parameters::</p>

            <div>
              ```
              [
                  ["id", "int8", "primary_key"],
                  ["dept_id", "int8", "primary_key", "shard_key"],
                  ["manager_id", "int8", "nullable"],
                  ["first_name", "char32"],
                  ["last_name", "char64"],
                  ["salary", "decimal"],
                  ["hire_date", "date"]
              ]
              ```
            </div>

            <p>Each column definition consists of the column name (which should meet the standard column naming criteria), the column's specific type (int, long, float, double, string, bytes, or any of the properties map values from <code>create\_type</code>), and any data handling, data key, or data replacement properties.</p>
            <p>A table may optionally be designated to use a replicated distribution scheme, or be assigned: foreign keys to other tables, a partitioning scheme, and/or a tier strategy.</p>
          </div>

          <div className="tsd-parameters">
            <h4 className="tsd-parameters-title">Parameters</h4>

            <ul className="tsd-parameter-list">
              <li>
                <span><span className="tsd-kind-parameter">table\_name</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Name of the table to be created, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria. Error for requests with existing table of the same name and type ID may be suppressed by using the no\_error\_if\_exists option.</p>
                </div>
              </li>

              <li>
                <span><span className="tsd-kind-parameter">type\_id</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>The type for the table, specified as either an existing table's numerical type ID (as returned by <code>create\_type</code>) or a type definition (as described above).</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">options</span>: <span className="tsd-signature-type">Record</span><span className="tsd-signature-symbol">\<</span><span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">></span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional parameters.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">callback</span>: <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional callback function</p>
                </div>
              </li>
            </ul>
          </div>

          <h4 className="tsd-returns-title">Returns <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/CreateTableResponse" className="tsd-signature-type tsd-kind-interface">CreateTableResponse</a><span className="tsd-signature-symbol">></span></h4>
          <p>Promise\<Types.CreateTableResponse> - Promise resolving to the response</p>

          <div className="aside tsd-sources">
            <ul>
              <li>Defined in <a href="https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L6677">src/GPUdb.ts:6677</a></li>
            </ul>
          </div>
        </div>
      </li>
    </ul>
  </div>

  <div className="section tsd-panel tsd-member">
    <h3 className="tsd-anchor-link" id="create_table_request"><span>create\_table\_request</span></h3>

    <ul className="tsd-signatures">
      <li className="">
        <div className="tsd-signature tsd-anchor-link" id="create_table_request-1"><span className="tsd-kind-call-signature">create\_table\_request</span><span className="tsd-signature-symbol">(</span><br /> <span className="tsd-kind-parameter">request</span><span className="tsd-signature-symbol">:</span> <a href="/content/api/typescript/interfaces/CreateTableRequest" className="tsd-signature-type tsd-kind-interface">CreateTableRequest</a><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">callback</span><span className="tsd-signature-symbol">?:</span> <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a><span className="tsd-signature-symbol">,</span><br /><span className="tsd-signature-symbol">)</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/CreateTableResponse" className="tsd-signature-type tsd-kind-interface">CreateTableResponse</a><span className="tsd-signature-symbol">></span></div>

        <div className="tsd-description">
          <div className="tsd-comment tsd-typography">
            <p>Creates a new table with the given type (definition of columns). The type is specified in <code>type\_id</code> as either a numerical type ID (as returned by <code>create\_type</code>) or as a list of columns, each specified as a list of the column name, data type, and any column attributes.</p>
            <p>Example of a type definition with some parameters::</p>

            <div>
              ```
              [
                  ["id", "int8", "primary_key"],
                  ["dept_id", "int8", "primary_key", "shard_key"],
                  ["manager_id", "int8", "nullable"],
                  ["first_name", "char32"],
                  ["last_name", "char64"],
                  ["salary", "decimal"],
                  ["hire_date", "date"]
              ]
              ```
            </div>

            <p>Each column definition consists of the column name (which should meet the standard column naming criteria), the column's specific type (int, long, float, double, string, bytes, or any of the properties map values from <code>create\_type</code>), and any data handling, data key, or data replacement properties.</p>
            <p>A table may optionally be designated to use a replicated distribution scheme, or be assigned: foreign keys to other tables, a partitioning scheme, and/or a tier strategy.</p>
          </div>

          <div className="tsd-parameters">
            <h4 className="tsd-parameters-title">Parameters</h4>

            <ul className="tsd-parameter-list">
              <li>
                <span><span className="tsd-kind-parameter">request</span>: <a href="/content/api/typescript/interfaces/CreateTableRequest" className="tsd-signature-type tsd-kind-interface">CreateTableRequest</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Request object containing the parameters for the operation</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">callback</span>: <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional callback function</p>
                </div>
              </li>
            </ul>
          </div>

          <h4 className="tsd-returns-title">Returns <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/CreateTableResponse" className="tsd-signature-type tsd-kind-interface">CreateTableResponse</a><span className="tsd-signature-symbol">></span></h4>
          <p>Promise\<Types.CreateTableResponse> - Promise resolving to the response</p>

          <div className="aside tsd-sources">
            <ul>
              <li>Defined in <a href="https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L6621">src/GPUdb.ts:6621</a></li>
            </ul>
          </div>
        </div>
      </li>
    </ul>
  </div>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.