{"id":339,"date":"2015-12-05T14:38:53","date_gmt":"2015-12-05T07:38:53","guid":{"rendered":"http:\/\/www.sqlitetutorial.net\/?page_id=339"},"modified":"2024-04-29T10:21:23","modified_gmt":"2024-04-29T03:21:23","slug":"sqlite-create-table","status":"publish","type":"page","link":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/","title":{"rendered":"SQLite Create Table"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to create new tables using SQLite <code>CREATE TABLE<\/code> statement using various options.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to SQLite CREATE TABLE statement<\/h2>\n\n\n\n<p>To create a new table in SQLite, you use <code>CREATE TABLE<\/code> statement using the following syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> &#91;<span class=\"hljs-keyword\">IF<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-keyword\">EXISTS<\/span>] &#91;schema_name].table_name (\n\tcolumn_1 data_type PRIMARY <span class=\"hljs-keyword\">KEY<\/span>,\n   \tcolumn_2 data_type <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n\tcolumn_3 data_type <span class=\"hljs-keyword\">DEFAULT<\/span> <span class=\"hljs-number\">0<\/span>,\n\ttable_constraints\n) &#91;<span class=\"hljs-keyword\">WITHOUT<\/span> <span class=\"hljs-keyword\">ROWID<\/span>];<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, specify the name of the table that you want to create after the <code>CREATE TABLE<\/code> keywords. The name of the table cannot start with <code>sqlite_<\/code> because it is reserved for the internal use of SQLite.<\/li>\n\n\n\n<li>Second, use <code>IF NOT EXISTS<\/code> option to create a new table if it does not exist. Attempting to create a table that already exists without using the <code>IF NOT EXISTS<\/code> option will result in an error.<\/li>\n\n\n\n<li>Third, optionally specify the <code>schema_name<\/code> to which the new table belongs. The schema can be the main database, <code>temp<\/code> database or any attached database.<\/li>\n\n\n\n<li>Fourth, specify the column list of the table. Each column has a name, data type, and the column constraint. SQLite supports <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-primary-key\/\">PRIMARY KEY<\/a><\/code>, <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-unique-constraint\/\">UNIQUE<\/a><\/code>, <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-not-null-constraint\/\">NOT NULL<\/a><\/code>,\u00a0and\u00a0<code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-check-constraint\/\">CHECK<\/a><\/code> column constraints.<\/li>\n\n\n\n<li>Fifth, specify the table constraints such as <code>PRIMARY KEY<\/code>, <code>FOREIGN KEY<\/code>, <code>UNIQUE<\/code>, and <code>CHECK<\/code> constraints.<\/li>\n\n\n\n<li>Finally, optionally use the <code>WITHOUT ROWID<\/code> option. By default, a row in a table has an implicit column, which is referred to as the <code>rowid<\/code>, <code>oid<\/code> or <code>_rowid_<\/code> column. The <code>rowid<\/code> column stores a 64-bit signed integer key that uniquely identifies the row inside the table. If you don&#8217;t want SQLite creates the <code>rowid<\/code> column, you specify the <code>WITHOUT ROWID<\/code> option. A table that contains the <code>rowid<\/code> column is known as a <code>rowid<\/code> table. Note that the <code>WITHOUT ROWID<\/code> option is only available in SQLite 3.8.2 or later.<\/li>\n<\/ul>\n\n\n\n<p>Note that the <a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-primary-key\/\">primary key<\/a> of a table is a column or a group of columns that uniquely identify each row in the table.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">SQLite CREATE TABLE examples<\/h2>\n\n\n\n<p>Suppose you have to manage contacts using SQLite.<\/p>\n\n\n\n<p>Each contact has the following information:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First name<\/li>\n\n\n\n<li>Last name<\/li>\n\n\n\n<li>Email<\/li>\n\n\n\n<li>Phone<\/li>\n<\/ul>\n\n\n\n<p>The requirement is that the email and phone must be unique. In addition, each contact belongs to one or many groups, and each group can have zero or many contacts.<\/p>\n\n\n\n<p>Based on these requirements, we came up with three tables:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>contacts<\/code> table that stores contact information.<\/li>\n\n\n\n<li>The <code>groups<\/code> table that stores group information.<\/li>\n\n\n\n<li>The <code>contact_groups<\/code> table that stores the relationship between contacts and groups.<\/li>\n<\/ul>\n\n\n\n<p>The following database diagram illustrates tables: <code>contacts<\/code> <code>groups<\/code>, and <code>contact_groups.<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg\" alt=\"SQLite Create Table\"\/><\/figure>\n\n\n\n<p>The following statement creates the <code>contacts<\/code> table.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> contacts (\n\tcontact_id <span class=\"hljs-built_in\">INTEGER<\/span> PRIMARY <span class=\"hljs-keyword\">KEY<\/span>,\n\tfirst_name <span class=\"hljs-built_in\">TEXT<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n\tlast_name <span class=\"hljs-built_in\">TEXT<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>,\n\temail <span class=\"hljs-built_in\">TEXT<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span> <span class=\"hljs-keyword\">UNIQUE<\/span>,\n\tphone <span class=\"hljs-built_in\">TEXT<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span> <span class=\"hljs-keyword\">UNIQUE<\/span>\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-create-table\/#1\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\n\n\n\n<p>The <code>contact_id<\/code> is the primary key of the <code>contacts<\/code> table.<\/p>\n\n\n\n<p>Because the primary key consists of one column, you can use the column constraint.<\/p>\n\n\n\n<p>The <code>first_name<\/code> and <code>last_name<\/code> columns have <code>TEXT<\/code> storage class and these columns are <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-not-null-constraint\/\">NOT NULL<\/a><\/code>. It means that you must provide values when you <a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-insert\/\">insert<\/a> or <a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-update\/\">update<\/a> rows in the <code>contacts<\/code> table.<\/p>\n\n\n\n<p>The email and phone are unique therefore we use the <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-unique-constraint\/\">UNIQUE<\/a><\/code> constraint for each column.<\/p>\n\n\n\n<p>The following statement creates the <code>groups<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> <span class=\"hljs-keyword\">groups<\/span> (\n   <span class=\"hljs-keyword\">group_id<\/span> <span class=\"hljs-built_in\">INTEGER<\/span> PRIMARY <span class=\"hljs-keyword\">KEY<\/span>,\n   <span class=\"hljs-keyword\">name<\/span> <span class=\"hljs-built_in\">TEXT<\/span> <span class=\"hljs-keyword\">NOT<\/span> <span class=\"hljs-literal\">NULL<\/span>\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-create-table\/#2\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\n\n\n\n<p>The <code>groups<\/code> table is quite simple with two columns: <code>group_id<\/code> and <code>name<\/code>. The <code>group_id<\/code> column is the primary key column.<\/p>\n\n\n\n<p>The following statement creates <code>contact_groups<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">CREATE<\/span> <span class=\"hljs-keyword\">TABLE<\/span> contact_groups(\n   contact_id <span class=\"hljs-built_in\">INTEGER<\/span>,\n   <span class=\"hljs-keyword\">group_id<\/span> <span class=\"hljs-built_in\">INTEGER<\/span>,\n   PRIMARY <span class=\"hljs-keyword\">KEY<\/span> (contact_id, <span class=\"hljs-keyword\">group_id<\/span>),\n   <span class=\"hljs-keyword\">FOREIGN<\/span> <span class=\"hljs-keyword\">KEY<\/span> (contact_id) \n      <span class=\"hljs-keyword\">REFERENCES<\/span> contacts (contact_id) \n         <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">CASCADE<\/span> \n         <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">UPDATE<\/span> <span class=\"hljs-keyword\">NO<\/span> <span class=\"hljs-keyword\">ACTION<\/span>,\n   <span class=\"hljs-keyword\">FOREIGN<\/span> <span class=\"hljs-keyword\">KEY<\/span> (<span class=\"hljs-keyword\">group_id<\/span>) \n      <span class=\"hljs-keyword\">REFERENCES<\/span> <span class=\"hljs-keyword\">groups<\/span> (<span class=\"hljs-keyword\">group_id<\/span>) \n         <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">CASCADE<\/span> \n         <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">UPDATE<\/span> <span class=\"hljs-keyword\">NO<\/span> <span class=\"hljs-keyword\">ACTION<\/span>\n);<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p><a class=\"sql\" href=\"https:\/\/www.sqlitetutorial.net\/tryit\/query\/sqlite-create-table\/#3\" target=\"_blank\" rel=\"noopener noreferrer\">Try It<\/a><\/p>\n\n\n\n<p>The <code>contact_groups<\/code> table has a primary key that consists of two columns: <code>contact_id<\/code> and <code>group_id<\/code>.<\/p>\n\n\n\n<p>To add the table primary key constraint, you use this syntax:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">PRIMARY KEY (contact_id, group_id)<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In addition, the <code>contact_id<\/code> and <code>group_id<\/code> are the foreign keys. Therefore, you use <code><a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-foreign-key\/\">FOREIGN KEY<\/a><\/code> constraint to define a foreign key for each column.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">FOREIGN KEY (contact_id) \n   REFERENCES contacts (contact_id) \n      ON <span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">CASCADE<\/span> \n      <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">UPDATE<\/span> <span class=\"hljs-keyword\">NO<\/span> <span class=\"hljs-keyword\">ACTION<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">FOREIGN KEY (group_id) \n    REFERENCES groups (group_id) \n      ON <span class=\"hljs-keyword\">DELETE<\/span> <span class=\"hljs-keyword\">CASCADE<\/span> \n      <span class=\"hljs-keyword\">ON<\/span> <span class=\"hljs-keyword\">UPDATE<\/span> <span class=\"hljs-keyword\">NO<\/span> <span class=\"hljs-keyword\">ACTION<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Note that we will discuss in the <a href=\"https:\/\/www.sqlitetutorial.net\/sqlite-foreign-key\/\"><code>FOREIGN KEY<\/code><\/a> constraint in detail in the subsequent tutorial.<\/p>\n\n\n\n<p>In this tutorial, you have learned how to create a new table with various options using SQLite <code>CREATE TABLE<\/code> statement.<\/p>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful ?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"339\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\"\n\t\t\t\tdata-post-title=\"SQLite Create Table\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"339\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\"\n\t\t\t\tdata-post-title=\"SQLite Create Table\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to create new tables using SQLite CREATE TABLE statement using various options.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":2,"menu_order":43,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-339","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQLite Create Table with Examples<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT ROWID.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQLite Create Table with Examples\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT ROWID.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\" \/>\n<meta property=\"og:site_name\" content=\"SQLite Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T03:21:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427\"},\"headline\":\"SQLite Create Table\",\"datePublished\":\"2015-12-05T07:38:53+00:00\",\"dateModified\":\"2024-04-29T03:21:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\"},\"wordCount\":530,\"image\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\",\"url\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\",\"name\":\"SQLite Create Table with Examples\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg\",\"datePublished\":\"2015-12-05T07:38:53+00:00\",\"dateModified\":\"2024-04-29T03:21:23+00:00\",\"description\":\"In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT ROWID.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage\",\"url\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg\",\"contentUrl\":\"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg\",\"width\":559,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlitetutorial.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQLite Tutorial\",\"item\":\"https:\/\/www.sqlitetutorial.net\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQLite Create Table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/#website\",\"url\":\"https:\/\/www.sqlitetutorial.net\/\",\"name\":\"SQLite Tutorial\",\"description\":\"A Step-by-step SQLite Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlitetutorial.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427\",\"name\":\"admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQLite Create Table with Examples","description":"In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT ROWID.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/","og_locale":"en_US","og_type":"article","og_title":"SQLite Create Table with Examples","og_description":"In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT ROWID.","og_url":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/","og_site_name":"SQLite Tutorial","article_modified_time":"2024-04-29T03:21:23+00:00","og_image":[{"url":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#article","isPartOf":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/"},"author":{"name":"admin","@id":"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427"},"headline":"SQLite Create Table","datePublished":"2015-12-05T07:38:53+00:00","dateModified":"2024-04-29T03:21:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/"},"wordCount":530,"image":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/","url":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/","name":"SQLite Create Table with Examples","isPartOf":{"@id":"https:\/\/www.sqlitetutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg","datePublished":"2015-12-05T07:38:53+00:00","dateModified":"2024-04-29T03:21:23+00:00","description":"In this tutorial, you will learn how to create a new table using SQLite CREATE TABLE statement with various options such as WITHOUT ROWID.","breadcrumb":{"@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#primaryimage","url":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg","contentUrl":"https:\/\/www.sqlitetutorial.net\/wp-content\/uploads\/2015\/12\/SQLite-CREATE-TABLE-example.jpg","width":559,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlitetutorial.net\/sqlite-create-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlitetutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQLite Tutorial","item":"https:\/\/www.sqlitetutorial.net\/"},{"@type":"ListItem","position":3,"name":"SQLite Create Table"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlitetutorial.net\/#website","url":"https:\/\/www.sqlitetutorial.net\/","name":"SQLite Tutorial","description":"A Step-by-step SQLite Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlitetutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlitetutorial.net\/#\/schema\/person\/6d69b968cad0102e30d6694ed8dc6427","name":"admin"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/comments?post=339"}],"version-history":[{"count":2,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/339\/revisions"}],"predecessor-version":[{"id":3409,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/339\/revisions\/3409"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/pages\/2"}],"wp:attachment":[{"href":"https:\/\/www.sqlitetutorial.net\/wp-json\/wp\/v2\/media?parent=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}