{"id":438,"date":"2019-10-19T11:41:03","date_gmt":"2019-10-19T04:41:03","guid":{"rendered":"https:\/\/mariadbtutorial.com\/?page_id=438"},"modified":"2020-04-11T23:24:03","modified_gmt":"2020-04-11T16:24:03","slug":"mariadb-create-table","status":"publish","type":"page","link":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/","title":{"rendered":"MariaDB Create Table"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the MariaDB <code>create table<\/code> statement to create a new table in a database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Introduction to MariaDB create table statement<\/h2>\n\n\n\n<p>The <code>create table<\/code> statement allows you to create a new table in a database.<\/p>\n\n\n\n<p>Here is the basic syntax of the <code>create table<\/code> statement:<\/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>] table_name(\n    column_1_definition,\n    column_2_definition,\n    ...,\n    table_constraints\n) <span class=\"hljs-keyword\">engine<\/span>=storage_engine;\n<\/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\"><li>First, specify the name of the table that you want to create after the <code>create table<\/code> keywords. The table name must be unique within a database.<\/li><li>Second, use the <code>if not exists<\/code> option to conditionally create the new table only if it does not exist.<\/li><li>Third, specify a list of columns for the table within the parentheses, the columns are separated by commas (,).<\/li><li>Fourth, specify table constraints like primary key, foreign key, check, and unique after the column list.<\/li><li>Finally, optionally specify a storage engine for the table in the <code>engine<\/code> clause. If you skip the storage engine, MariaDB will use the InnoDB by default.<\/li><\/ul>\n\n\n\n<p>MariaDB has made InnoDB as the default storage engine since version 10.2. The InnoDB is a good transaction storage engine that supports ACID, referential integrity, and crash recovery.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">column definition<\/h3>\n\n\n\n<p>To define a column for a table, you use the following syntax:<\/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\">column_name data_type(length) &#91;not null] &#91;default value] &#91;auto_increment] column_constraint;\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>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>First, specify the name of the column.<\/li><li>Next, specify the data type and maximum length of the column if the data type requires it.<\/li><li>Then, use the <code>not null<\/code> to enforce non-null values in the column. Besides the not null constraint, you can use the check and primary key column constraints for the column.<\/li><li>After that, use the <code>default value<\/code> clause to specify a default value for the column when the insert and update statements do not explicitly specify it.<\/li><li>Finally, use the <code>auto_increment<\/code> property to instruct MariaDB to implicitly generate sequential integers for the column. A table has one and only one column with the <code>auto_increment<\/code> property.<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">or replace option<\/h3>\n\n\n\n<p>The <code>create table<\/code> statement has an <code>or replace<\/code> option:<\/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> &#91;<span class=\"hljs-keyword\">or<\/span> <span class=\"hljs-keyword\">replace<\/span>] table_name (\n    ...\n);\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>The <code>or replace<\/code> option drops the table if it exists and creates a new one. It is a shortcut for the following sequence of statements:<\/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\">drop<\/span> <span class=\"hljs-keyword\">table<\/span> <span class=\"hljs-keyword\">if<\/span> <span class=\"hljs-keyword\">exists<\/span> table_name;\n\n<span class=\"hljs-keyword\">create<\/span> <span class=\"hljs-keyword\">table<\/span> table_name(\n    ...\n);\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>Note that you cannot use the <code>or replace<\/code> and <code>if not exists<\/code> option at the same time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">MariaDB create table statement examples<\/h2>\n\n\n\n<p>Let&#8217;s take some examples of using the <code>create table<\/code> statement.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A) Using MariaDB create table statement to create a simple table example<\/h3>\n\n\n\n<p>The following example uses the <code>create table<\/code> statement to create a new table called <code>projects<\/code>:<\/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\"><span class=\"hljs-keyword\">create<\/span> <span class=\"hljs-keyword\">table<\/span> projects(\n    project_id <span class=\"hljs-built_in\">int<\/span> auto_increment,\n    project_name <span class=\"hljs-built_in\">varchar<\/span>(<span class=\"hljs-number\">255<\/span>) <span class=\"hljs-keyword\">not<\/span> <span class=\"hljs-literal\">null<\/span>,\n    begin_date <span class=\"hljs-built_in\">date<\/span>,\n    end_date <span class=\"hljs-built_in\">date<\/span>,\n    <span class=\"hljs-keyword\">cost<\/span> <span class=\"hljs-built_in\">decimal<\/span>(<span class=\"hljs-number\">15<\/span>,<span class=\"hljs-number\">2<\/span>) <span class=\"hljs-keyword\">not<\/span> <span class=\"hljs-literal\">null<\/span>,\n    created_at <span class=\"hljs-built_in\">timestamp<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-keyword\">current_timestamp<\/span>,\n    primary <span class=\"hljs-keyword\">key<\/span>(project_id)\n);\n<\/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>The <code>projects<\/code> table has six columns:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The <code>project_id<\/code> is an integer column. It has the <code>auto_increment<\/code> property, therefore, MariaDB will automatically generate a sequential number when you insert a row into the table. In addition, the <code>project_id<\/code> column is the primary key specified by the primary key constraint at the end of the table. It means that a value in the <code>project_id<\/code> column will uniquely identify a row in the table.<\/li><li>The <code>project_name<\/code> is a variable-length character with a maximum size of 255 characters. Because it has a <code>not null<\/code> constraint, you cannot insert <code>null<\/code> values into this column.<\/li><li>The <code>begin_date<\/code> and <code>end_date<\/code> are the date columns. They accept dates and null values only.<\/li><li>The <code>cost<\/code> is a decimal column that also does not accept null values.<\/li><li>The <code>created_at<\/code> column is a timestamp column that accepts date and time values. In addition, its default value is the current timestamp of the operating system on which the MariaDB server runs.<\/li><\/ul>\n\n\n\n<p>Because we don&#8217;t explicitly specify the storage engine for the projects table, it takes InnoDB as the storage engine.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">B) Using MariaDB create table statement to create a table with a foreign key constraint<\/h3>\n\n\n\n<p>The following example uses the <code>create table<\/code> statement to create a new table called <code>milestones<\/code>:<\/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\"><span class=\"hljs-keyword\">create<\/span> <span class=\"hljs-keyword\">table<\/span> milestones(\n    milestone_id <span class=\"hljs-built_in\">int<\/span> auto_increment,\n    project_id <span class=\"hljs-built_in\">int<\/span>,\n    milestone <span class=\"hljs-built_in\">varchar<\/span>(<span class=\"hljs-number\">255<\/span>) <span class=\"hljs-keyword\">not<\/span> <span class=\"hljs-literal\">null<\/span>,\n    start_date <span class=\"hljs-built_in\">date<\/span> <span class=\"hljs-keyword\">not<\/span> <span class=\"hljs-literal\">null<\/span>,\n    end_date <span class=\"hljs-built_in\">date<\/span> <span class=\"hljs-keyword\">not<\/span> <span class=\"hljs-literal\">null<\/span>,\n    completed <span class=\"hljs-built_in\">bool<\/span> <span class=\"hljs-keyword\">default<\/span> <span class=\"hljs-literal\">false<\/span>,\n    primary <span class=\"hljs-keyword\">key<\/span>(milestone_id, project_id),\n    <span class=\"hljs-keyword\">foreign<\/span> <span class=\"hljs-keyword\">key<\/span>(project_id)\n        <span class=\"hljs-keyword\">references<\/span> projects(project_id)\n);\n<\/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\n<p>In the <code>milestones<\/code> table, the primary key consists of two columns <code>milestone_id<\/code> and <code>project_id<\/code> specified by the following table constraint:<\/p>\n\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\">primary key(milestone_id, project_id)\n<\/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>It means that a milestone will not exist without a project.<\/p>\n\n\n\n<p>The <code>project_id<\/code> column is the foreign key column that references the <code>project_id<\/code> column of the <code>projects<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">foreign key(project_id)\n    references projects(project_id)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><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>The following diagram illustrates the relationship between projects and milestones tables:<\/p>\n\n\n\n<p>In this relationship, a project may have one or more milestones while each milestone belongs to only one project. This relationship is called the one-to-many.<\/p>\n\n\n\n<p>In this tutorial, you have learned how to use MariaDB <code>create table<\/code> statement to create a new table in the database.<\/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=\"438\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\"\n\t\t\t\tdata-post-title=\"MariaDB 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=\"438\"\n\t\t\t\tdata-post-url=\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\"\n\t\t\t\tdata-post-title=\"MariaDB 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 use the MariaDB create table statement to create a new table in a database.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":95,"menu_order":30,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-438","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>MariaDB Create Table<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn how to use the MariaDB create table statement to create a new table in a database.\" \/>\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.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MariaDB Create Table\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn how to use the MariaDB create table statement to create a new table in a database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\" \/>\n<meta property=\"og:site_name\" content=\"MariaDB Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2020-04-11T16:24:03+00:00\" \/>\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=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\",\"url\":\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\",\"name\":\"MariaDB Create Table\",\"isPartOf\":{\"@id\":\"https:\/\/www.mariadbtutorial.com\/#website\"},\"datePublished\":\"2019-10-19T04:41:03+00:00\",\"dateModified\":\"2020-04-11T16:24:03+00:00\",\"description\":\"In this tutorial, you will learn how to use the MariaDB create table statement to create a new table in a database.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.mariadbtutorial.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MariaDB Basics\",\"item\":\"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"MariaDB Create Table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.mariadbtutorial.com\/#website\",\"url\":\"https:\/\/www.mariadbtutorial.com\/\",\"name\":\"MariaDB Tutorial\",\"description\":\"MariaDB Tutorial\",\"publisher\":{\"@id\":\"https:\/\/www.mariadbtutorial.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.mariadbtutorial.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.mariadbtutorial.com\/#organization\",\"name\":\"MariaDB Tutorial\",\"url\":\"https:\/\/www.mariadbtutorial.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.mariadbtutorial.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/mariadbtutorial.com\/wp-content\/uploads\/2019\/06\/favicon.png\",\"contentUrl\":\"https:\/\/mariadbtutorial.com\/wp-content\/uploads\/2019\/06\/favicon.png\",\"width\":512,\"height\":592,\"caption\":\"MariaDB Tutorial\"},\"image\":{\"@id\":\"https:\/\/www.mariadbtutorial.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MariaDB Create Table","description":"In this tutorial, you will learn how to use the MariaDB create table statement to create a new table in a database.","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.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/","og_locale":"en_US","og_type":"article","og_title":"MariaDB Create Table","og_description":"In this tutorial, you will learn how to use the MariaDB create table statement to create a new table in a database.","og_url":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/","og_site_name":"MariaDB Tutorial","article_modified_time":"2020-04-11T16:24:03+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/","url":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/","name":"MariaDB Create Table","isPartOf":{"@id":"https:\/\/www.mariadbtutorial.com\/#website"},"datePublished":"2019-10-19T04:41:03+00:00","dateModified":"2020-04-11T16:24:03+00:00","description":"In this tutorial, you will learn how to use the MariaDB create table statement to create a new table in a database.","breadcrumb":{"@id":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/mariadb-create-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.mariadbtutorial.com\/"},{"@type":"ListItem","position":2,"name":"MariaDB Basics","item":"https:\/\/www.mariadbtutorial.com\/mariadb-basics\/"},{"@type":"ListItem","position":3,"name":"MariaDB Create Table"}]},{"@type":"WebSite","@id":"https:\/\/www.mariadbtutorial.com\/#website","url":"https:\/\/www.mariadbtutorial.com\/","name":"MariaDB Tutorial","description":"MariaDB Tutorial","publisher":{"@id":"https:\/\/www.mariadbtutorial.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mariadbtutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mariadbtutorial.com\/#organization","name":"MariaDB Tutorial","url":"https:\/\/www.mariadbtutorial.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mariadbtutorial.com\/#\/schema\/logo\/image\/","url":"https:\/\/mariadbtutorial.com\/wp-content\/uploads\/2019\/06\/favicon.png","contentUrl":"https:\/\/mariadbtutorial.com\/wp-content\/uploads\/2019\/06\/favicon.png","width":512,"height":592,"caption":"MariaDB Tutorial"},"image":{"@id":"https:\/\/www.mariadbtutorial.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/pages\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":2,"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/pages\/438\/revisions"}],"predecessor-version":[{"id":736,"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/pages\/438\/revisions\/736"}],"up":[{"embeddable":true,"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/pages\/95"}],"wp:attachment":[{"href":"https:\/\/www.mariadbtutorial.com\/wp-json\/wp\/v2\/media?parent=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}