{"id":20323,"date":"2022-12-02T06:51:00","date_gmt":"2022-12-02T05:51:00","guid":{"rendered":"https:\/\/expert-only.com\/?p=20323"},"modified":"2023-01-03T12:39:54","modified_gmt":"2023-01-03T11:39:54","slug":"create-and-modify-a-mysql-table","status":"publish","type":"post","link":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/","title":{"rendered":"Create and modify a MySQL table"},"content":{"rendered":"\n<h4 class=\"has-text-align-center wp-block-heading\"><strong><em>How to create, modify, and drop a MySQL table using SQL scripts?<\/em><\/strong><\/h4>\n\n\n\n<p>Tutorial to learn how to create, modify, empty, and drop a table with MySQL scripts. MySQL is a relational database management system (RDBMS) that allows you to store and manage data in an organized way. In this tutorial, we will see how to create a table, insert data into it, delete data from it, modify the table to add or delete columns, clear all data from the table, and delete the table.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#1-create-a-mysql-table\" >1. Create a MySQL table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#2-insert-data-into-a-mysql-table\" >2. Insert data into a MySQL table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#3-delete-data-with-mysql\" >3. Delete data with MySQL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#31-deleting-all-data-from-a-mysql-table\" >3.1 Deleting all data from a MySQL table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#32-deleting-specific-data-from-a-mysql-table\" >3.2 Deleting specific data from a MySQL table<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#4-modify-columns-with-mysql\" >4. Modify columns with MySQL<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#41-adding-a-mysql-column\" >4.1 Adding a MySQL Column<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#42-deleting-a-column-from-a-mysql-table\" >4.2 Deleting a Column from a MySQL Table<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#5-clear-all-data-from-a-mysql-table\" >5. Clear all data from a MySQL table<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#6-drop-a-mysql-table-from-a-database\" >6. Drop a MySQL table from a database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#7-conclusion-on-how-to-manage-mysql-tables\" >7. Conclusion on how to manage MySQL tables<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"h-1-create-a-mysql-table\"><span class=\"ez-toc-section\" id=\"1-create-a-mysql-table\"><\/span>1. Create a MySQL table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To create a table in a MySQL database, we use the CREATE TABLE command. Here is an example code that creates a table named users with two columns, id and username, respectively of type INT and VARCHAR(255).<\/p>\n\n\n\n<p>The following code create a MySQL table, to execute it, connect to PHPMyAdmin and run the code. This will create a <code>users<\/code> table with 5 different columns.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong><em>id<\/em><\/strong> : an integer that will be automatically incremented and used as the primary key for the table<\/li>\n\n\n\n<li><strong><em>username<\/em><\/strong>: a string with a maximum length of 255 characters, and is not allowed to be NULL<\/li>\n\n\n\n<li><strong><em>email<\/em><\/strong>: a string with a maximum length of 255 characters, and is not allowed to be NULL<\/li>\n\n\n\n<li><strong><em>password<\/em><\/strong>: a string with a maximum length of 255 characters, and is not allowed to be NULL<\/li>\n\n\n\n<li><strong><em>created_at<\/em><\/strong>: a datetime value that will be set to the current timestamp by default<\/li>\n<\/ol>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">CREATE TABLE users (\n  id INTEGER PRIMARY KEY AUTOINCREMENT,\n  username VARCHAR(255) NOT NULL,\n  email VARCHAR(255) NOT NULL,\n  password VARCHAR(255) NOT NULL,\n  created_at DATETIME DEFAULT CURRENT_TIMESTAMP\n);\n<\/pre>\n\n\n\n<p>We can also specify constraints for each column. For example, we have defined the id column as the primary key of the table and as an auto-incremented integer.<\/p>\n\n\n\n<p>To verify that the table was successfully created, we can use the SHOW TABLES command, as follows.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">SHOW TABLES;\n<\/pre>\n\n\n\n<p>Check out this <a href=\"https:\/\/expert-only.com\/en\/excel\/create-excel-pivot-table\/\">detailed tutorial to create a Pivot Table with Excel<\/a> to analyse data easily.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"CwD46XW051\"><a href=\"https:\/\/expert-only.com\/en\/excel\/create-excel-pivot-table\/\">Create an Excel pivot table<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Create an Excel pivot table&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/excel\/create-excel-pivot-table\/embed\/#?secret=CTLkwsS7Yx#?secret=CwD46XW051\" data-secret=\"CwD46XW051\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2-insert-data-into-a-mysql-table\"><\/span>2. Insert data into a MySQL table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To insert data into a MySQL table, we use the INSERT INTO command. Here is an example code that inserts a record into the users table:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INSERT INTO users (username, email, password)\n   VALUES ('johndoe', 'johndoe@example.com', 'mypassword');\n\n<\/pre>\n\n\n\n<p>We can also insert multiple records at once using the following syntax:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INSERT INTO users (username, email, password)\n   VALUES\n     ('johndoe', 'johndoe@example.com', 'mypassword'),\n     ('janedoe', 'janedoe@example.com', 'anotherpassword');\n<\/pre>\n\n\n\n<p>To insert a row and specifying the data type for each value, especially the DATE. Please note that the following statement will duplicate the line with the same name, because the primary key is the auto incremented ID and not the user name.<\/p>\n\n\n\n<p>To allow one unique name only, change the table structure to add a constraint on the username column.  <\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">INSERT INTO users (username, email, password, created_at)\n   VALUES ('johndoe', 'johndoe@example.com', 'mypassword', CAST('2022-01-01' AS DATE));\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3-delete-data-with-mysql\"><\/span>3. Delete data with MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To delete data from a MySQL table, we use the standard SQL DELETE FROM command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"31-deleting-all-data-from-a-mysql-table\"><\/span>3.1 Deleting all data from a MySQL table<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Here is an example code that deletes all records from the users table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DELETE FROM users;\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"32-deleting-specific-data-from-a-mysql-table\"><\/span>3.2 Deleting specific data from a MySQL table<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>We can also use a WHERE clause to specify deletion conditions. For example, to delete a record from the users table where the username is &#8216;johndoe&#8217;, we can use the following query.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DELETE FROM users\n   WHERE username = 'johndoe';\n<\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"VPSfqNqHbk\"><a href=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-recursively-with-cmd\/\">How to list Windows files recursively with cmd including subfolders?<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;How to list Windows files recursively with cmd including subfolders?&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/ms-dos\/list-files-recursively-with-cmd\/embed\/#?secret=sr4kkxLiuL#?secret=VPSfqNqHbk\" data-secret=\"VPSfqNqHbk\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4-modify-columns-with-mysql\"><\/span>4. Modify columns with MySQL<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>It is possible to modify a MySQL table by adding or deleting columns.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"41-adding-a-mysql-column\"><\/span>4.1 Adding a MySQL Column<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To add a column to a MySQL table, we use the ALTER TABLE and ADD COLUMN commands. Here is an example code that adds a column named email to the users table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ALTER TABLE users\n   ADD COLUMN email VARCHAR(255);\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"42-deleting-a-column-from-a-mysql-table\"><\/span>4.2 Deleting a Column from a MySQL Table<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>To delete a column from a MySQL table, we use the ALTER TABLE and DROP COLUMN commands. Here is an example code that deletes the email column from the users table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">ALTER TABLE users DROP COLUMN email;\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5-clear-all-data-from-a-mysql-table\"><\/span>5. Clear all data from a MySQL table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To clear all data from a MySQL table, we use the TRUNCATE TABLE command. Here is an example code that clears all data from the users table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">TRUNCATE TABLE users;\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6-drop-a-mysql-table-from-a-database\"><\/span>6. Drop a MySQL table from a database<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To delete a MySQL table, we use the DROP TABLE command. Here is an example code that deletes the users table.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">DROP TABLE users;\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7-conclusion-on-how-to-manage-mysql-tables\"><\/span>7. Conclusion on how to manage MySQL tables<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this tutorial, we have learned how to create, modify, clear, and delete a <a href=\"https:\/\/dev.mysql.com\/doc\/\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL<\/a> table using various SQL commands. It is important to note that these actions are irreversible, so it is always a good idea to make a backup of your data before making any changes. It is also recommended to use these commands with caution, as they can have a significant impact on your database.<\/p>\n\n\n\n<p>Another tutorial on how to <a href=\"https:\/\/expert-only.com\/en\/mysql\/create-table-mysql-with-primary-key\/\">connect to PHPMyAdmin and execute SQL queries to create a table<\/a> with a primary key.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-sql-and-it-tutorials wp-block-embed-sql-and-it-tutorials\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"II2NSktMQ5\"><a href=\"https:\/\/expert-only.com\/en\/mysql\/create-table-mysql-with-primary-key\/\">Create a table in MySQL with a primary key<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Create a table in MySQL with a primary key&#8221; &#8212; SQL and IT Tutorials\" src=\"https:\/\/expert-only.com\/en\/mysql\/create-table-mysql-with-primary-key\/embed\/#?secret=HDUCc26YKV#?secret=II2NSktMQ5\" data-secret=\"II2NSktMQ5\" width=\"500\" height=\"282\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>How to create, modify, and drop a MySQL table using SQL scripts? Tutorial to learn how to create, modify, empty, and drop a table with MySQL scripts. MySQL is a relational database management system (RDBMS) that allows you to <a class=\"mh-excerpt-more\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\" title=\"Create and modify a MySQL table\">&#8230;<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":10739,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[646],"tags":[],"class_list":{"0":"post-20323","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-mysql"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.7 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create and modify a MySQL table - Tables - MySQL<\/title>\n<meta name=\"description\" content=\"Tutorial to learn how to create, modify, delete data from, empty, and drop a table using MySQL scripts. And also insert data into the table.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create and modify a MySQL table\" \/>\n<meta property=\"og:description\" content=\"Tutorial to learn how to create, modify, delete data from, empty, and drop a table using MySQL scripts. And also insert data into the table.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL and IT Tutorials\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-02T05:51:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-03T11:39:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Expert-Only\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@expert_only\" \/>\n<meta name=\"twitter:site\" content=\"@expert_only\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Expert-Only\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\"},\"author\":{\"name\":\"Expert-Only\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\"},\"headline\":\"Create and modify a MySQL table\",\"datePublished\":\"2022-12-02T05:51:00+00:00\",\"dateModified\":\"2023-01-03T11:39:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\"},\"wordCount\":746,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg\",\"articleSection\":[\"MySQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\",\"url\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\",\"name\":\"Create and modify a MySQL table - Tables - MySQL\",\"isPartOf\":{\"@id\":\"https:\/\/expert-only.com\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg\",\"datePublished\":\"2022-12-02T05:51:00+00:00\",\"dateModified\":\"2023-01-03T11:39:54+00:00\",\"description\":\"Tutorial to learn how to create, modify, delete data from, empty, and drop a table using MySQL scripts. And also insert data into the table.\",\"breadcrumb\":{\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"en\",\"item\":\"https:\/\/expert-only.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create and modify a MySQL table\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/expert-only.com\/en\/#website\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"name\":\"SQL and IT Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/expert-only.com\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/expert-only.com\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/expert-only.com\/en\/#organization\",\"name\":\"Expert-Only\",\"url\":\"https:\/\/expert-only.com\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"contentUrl\":\"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg\",\"width\":381,\"height\":174,\"caption\":\"Expert-Only\"},\"image\":{\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ExpertOnlyCom\/\",\"https:\/\/x.com\/expert_only\",\"https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef\",\"name\":\"Expert-Only\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g\",\"caption\":\"Expert-Only\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Create and modify a MySQL table - Tables - MySQL","description":"Tutorial to learn how to create, modify, delete data from, empty, and drop a table using MySQL scripts. And also insert data into the table.","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:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/","og_locale":"en_US","og_type":"article","og_title":"Create and modify a MySQL table","og_description":"Tutorial to learn how to create, modify, delete data from, empty, and drop a table using MySQL scripts. And also insert data into the table.","og_url":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/","og_site_name":"SQL and IT Tutorials","article_publisher":"https:\/\/www.facebook.com\/ExpertOnlyCom\/","article_published_time":"2022-12-02T05:51:00+00:00","article_modified_time":"2023-01-03T11:39:54+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg","type":"image\/jpeg"}],"author":"Expert-Only","twitter_card":"summary_large_image","twitter_creator":"@expert_only","twitter_site":"@expert_only","twitter_misc":{"Written by":"Expert-Only","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#article","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/"},"author":{"name":"Expert-Only","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef"},"headline":"Create and modify a MySQL table","datePublished":"2022-12-02T05:51:00+00:00","dateModified":"2023-01-03T11:39:54+00:00","mainEntityOfPage":{"@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/"},"wordCount":746,"commentCount":0,"publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"image":{"@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg","articleSection":["MySQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/","url":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/","name":"Create and modify a MySQL table - Tables - MySQL","isPartOf":{"@id":"https:\/\/expert-only.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage"},"image":{"@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage"},"thumbnailUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg","datePublished":"2022-12-02T05:51:00+00:00","dateModified":"2023-01-03T11:39:54+00:00","description":"Tutorial to learn how to create, modify, delete data from, empty, and drop a table using MySQL scripts. And also insert data into the table.","breadcrumb":{"@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#primaryimage","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2022\/09\/macro-1452986_1920x1080.jpg","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/expert-only.com\/en\/mysql\/create-and-modify-a-mysql-table\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"en","item":"https:\/\/expert-only.com\/en\/"},{"@type":"ListItem","position":2,"name":"Create and modify a MySQL table"}]},{"@type":"WebSite","@id":"https:\/\/expert-only.com\/en\/#website","url":"https:\/\/expert-only.com\/en\/","name":"SQL and IT Tutorials","description":"","publisher":{"@id":"https:\/\/expert-only.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/expert-only.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/expert-only.com\/en\/#organization","name":"Expert-Only","url":"https:\/\/expert-only.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","contentUrl":"https:\/\/expert-only.com\/wp-content\/uploads\/2017\/09\/cropped-logo_Expert-Only.jpg","width":381,"height":174,"caption":"Expert-Only"},"image":{"@id":"https:\/\/expert-only.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ExpertOnlyCom\/","https:\/\/x.com\/expert_only","https:\/\/www.youtube.com\/channel\/UCMS5sR_FwAetB0FmciNvUaA"]},{"@type":"Person","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/406a9576b52944f018739a42046873ef","name":"Expert-Only","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/expert-only.com\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/084b15660763ff5b13bb60b2f52f97bb?s=96&d=identicon&r=g","caption":"Expert-Only"}}]}},"_links":{"self":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/20323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/comments?post=20323"}],"version-history":[{"count":0,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/posts\/20323\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media\/10739"}],"wp:attachment":[{"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/media?parent=20323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/categories?post=20323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/expert-only.com\/en\/wp-json\/wp\/v2\/tags?post=20323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}