{"id":2579,"date":"2025-03-25T11:18:49","date_gmt":"2025-03-25T11:18:49","guid":{"rendered":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/?p=2579"},"modified":"2025-12-02T14:03:25","modified_gmt":"2025-12-02T14:03:25","slug":"how-to-create-table-in-mysql","status":"publish","type":"post","link":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html","title":{"rendered":"How to Create a Table in MySQL?"},"content":{"rendered":"\n<p>MySQL is a powerful database management system that helps store and organise data efficiently. But before storing any data, you need a structured place to keep it\u2014this is where tables come in!<\/p>\n\n\n\n<p>You have to think of a table as an Excel sheet with rows and columns. Each row holds a record, and each column represents a specific data type, like names, emails, or phone numbers.<\/p>\n\n\n\n<p>If you are new to MySQL and wondering how to create a table, don&#8217;t worry! This guide will walk you through the process in simple steps with easy-to-understand explanations.<\/p>\n\n\n\n<hr><p><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/396\/How-to-Install-phpMyAdmin-with-XAMPP.html\"><strong>How to Install phpMyAdmin with XAMPP?<\/strong><\/a><\/p><hr>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is a Table in MySQL?<\/strong><\/h2>\n\n\n\n<p>A table in MySQL is a structured format used to store data in a database. Each table consists of columns <strong>(fields) <\/strong>and rows <strong>(records)<\/strong>.<\/p>\n\n\n\n<p>Imagine you have a notebook where you write down your daily expenses. Each page represents a specific category (food, transport, or shopping), and each entry records details like date, amount, and description.<\/p>\n\n\n\n<p>A table in MySQL works the same way! It organizes information into a structured format using rows and columns.<\/p>\n\n\n\n<p>Think of it like an Excel sheet!<\/p>\n\n\n\n<p><strong>Here\u2019s a quick example:<\/strong><\/p>\n\n\n\n        <table style=\"border-collapse: collapse; width: 100%;\" border=\"1\">\n        <tbody>\n            <tr style=\"height: 18px;\">\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>ID<\/strong><\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Name<\/strong><\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Email<\/strong><\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\"><strong>Age<\/strong><\/span><\/p><\/td>\n            <\/tr>\n            <tr style=\"height: 18px;\">\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">1<\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">John Doe<\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">john@example.com<\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">25<\/span><\/p><\/td>\n            <\/tr>\n            <tr style=\"height: 18px;\">\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">2<\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">Jane Doe<\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">jane@example.com<\/span><\/p><\/td>\n                <td style=\"padding: 5px 10px; width: 25%; height: 18px; text-align: center;\"><p><span style=\"font-family: verdana, geneva, sans-serif;\">28<\/span><\/p><\/td>\n            <\/tr>\n        <\/tbody>    \n    <\/table>\n\n<br>\n\n<p>In this example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>ID<\/strong> is a unique identifier.<\/li>\n\n\n\n<li><strong>Name<\/strong> stores text values.<\/li>\n\n\n\n<li><strong>Email<\/strong> stores email addresses.<\/li>\n\n\n\n<li><strong>Age<\/strong> stores numerical values.<\/li>\n<\/ul>\n\n\n\n<p>Now, let\u2019s learn how to create a table in MySQL using the Command Line, MySQL Workbench, and cPanel.<\/p>\n\n\n\n<hr><p><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/374\/How-to-Change-MySQL-Database-User-Password-From-cPanel.html\"><strong>How to reset the password for a MySQL database?<\/strong><\/a><\/p><hr>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Ways to Create Table in MySQL<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a2 <strong>Method 1: Using the Command Line<\/strong><\/h3>\n\n\n\n<p>Using the command line is the most direct and efficient way to interact with MySQL. It allows developers and database administrators to quickly create, modify, and manage databases without relying on graphical tools.<\/p>\n\n\n\n<p>\u2794 First, open your MySQL command line and login by typing:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>mysql -u root -p<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2794 Press <strong>\u2018Enter,\u2019 <\/strong>then enter your password when prompted.<\/p>\n\n\n\n<p>\u2794 Before creating a table, choose the database where you want to store it. Use this command to ensure that the table is created inside the selected database.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>USE your_database_name;<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>*Note: <\/strong>Replace <strong>your_database_name <\/strong>with your database name.<\/p>\n\n\n\n<p>\u2794 Now, use the <strong>CREATE TABLE<\/strong> command to define your table structure. Let\u2019s create a <strong>Users<\/strong> table:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>CREATE TABLE Users (<\/strong><br><strong>\u00a0\u00a0\u00a0\u00a0ID INT AUTO_INCREMENT PRIMARY KEY,<\/strong><br><strong>\u00a0\u00a0\u00a0\u00a0Name VARCHAR(100) NOT NULL,<\/strong><br><strong>\u00a0\u00a0\u00a0\u00a0Email VARCHAR(255) UNIQUE,<\/strong><br><strong>\u00a0\u00a0\u00a0\u00a0Age INT,<\/strong><br><strong>\u00a0\u00a0\u00a0\u00a0Signup_Date TIMESTAMP DEFAULT CURRENT_TIMESTAMP<\/strong><br><strong>);<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2794 To check if your table was created successfully, you have to run:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>SHOW TABLES;<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2794 To see the table structure, use:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>DESCRIBE Users;<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2794 To insert data into the table, you have to use the <strong>INSERT INTO<\/strong> command:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>INSERT INTO Users (Name, Email, Age) VALUES (&#8216;John Doe&#8217;, &#8216;john@example.com&#8217;, 25);<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u2794 If you want to verify the data:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"kb_firewall\"><strong>SELECT * FROM Users;<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>This will show all the records in the <strong>Users<\/strong> table.<\/p>\n\n\n\n<hr><p><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/425\/remove-directory-in-linux.html\"><strong>How To Remove Directory in Linux With Command?<\/strong><\/a><\/p><hr>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a2 <strong>Method 2: Using MySQL Workbench<\/strong><\/h3>\n\n\n\n<p>MySQL Workbench is a graphical interface that makes it easier to manage MySQL databases without needing to write SQL commands manually. It is great for beginners and those who prefer a visual approach.<\/p>\n\n\n\n<p>\u2794 Firstly, open your MySQL Workbench. To launch it, connect it to your MySQL server.<\/p>\n\n\n\n<p>\u2794 In that, select the database where you want to create the table.<\/p>\n\n\n\n<p>\u2794 To create a table, you have to click on the <strong>\u2018Schemas\u2019<\/strong> tab on the left sidebar.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"506\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png\" alt=\"Click on schemas tab\" class=\"wp-image-2580\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png 634w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab-300x239.png 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 Select your database and right-click on the <strong>\u2018Tables\u2019 <\/strong>folder.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"380\" height=\"178\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Right-click-on-the-tables-folder.png\" alt=\"Right click on the tables folder\" class=\"wp-image-2581\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Right-click-on-the-tables-folder.png 380w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Right-click-on-the-tables-folder-300x141.png 300w\" sizes=\"auto, (max-width: 380px) 100vw, 380px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 From the options, click <strong>\u2018Create Table.\u2019<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"376\" height=\"195\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-create-table.png\" alt=\"Click on create table\" class=\"wp-image-2582\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-create-table.png 376w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-create-table-300x156.png 300w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 You have to enter the table name <strong>(e.g., New Users)<\/strong>.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"767\" height=\"250\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-table-name.png\" alt=\"Enter table name\" class=\"wp-image-2583\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-table-name.png 767w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-table-name-300x98.png 300w\" sizes=\"auto, (max-width: 767px) 100vw, 767px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 Now, you have to define table columns! You have to add columns by specifying Name, Data Type, and Constraints.<\/p>\n\n\n\n<p><strong>For example:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ID \u2192 <strong>INT, Primary Key, Auto Increment<\/strong><\/li>\n\n\n\n<li>Name \u2192 <strong>VARCHAR(100), NOT NULL<\/strong><\/li>\n\n\n\n<li>Email \u2192 <strong>VARCHAR(255), UNIQUE<\/strong><\/li>\n\n\n\n<li>Age \u2192 <strong>INT<\/strong><\/li>\n\n\n\n<li>Signup_Date \u2192 <strong>TIMESTAMP, DEFAULT CURRENT_TIMESTAMP<\/strong><\/li>\n<\/ul>\n\n\n\n<p>\u2794 Once done, it\u2019s time to save the table. Click <strong>\u2018Apply\u2019<\/strong> and review the generated SQL query.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"168\" height=\"49\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-Apply-to-save-table.png\" alt=\"Click on Apply to save table\" class=\"wp-image-2584\"\/><\/figure>\n<\/div>\n\n\n<p>\u2794 Once done, it\u2019s time to verify the table. To do this, go to the <strong>\u2018Tables\u2019 <\/strong>section under your database and find the newly created <strong>\u2018New Users\u2019<\/strong> table.<\/p>\n\n\n\n<p>\u2794 Right-click on it and choose <strong>Select Rows \u2013 Limit 1000<\/strong> to view its structure.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"341\" height=\"333\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/View-tables-structure.png\" alt=\"View table's structure\" class=\"wp-image-2585\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/View-tables-structure.png 341w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/View-tables-structure-300x293.png 300w\" sizes=\"auto, (max-width: 341px) 100vw, 341px\" \/><\/figure>\n<\/div>\n\n\n<hr><p><strong>Read More: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/344\/How-Do-I-Connect-MySQL-Database-Via-MySQL-Workbench.html\"><strong>How Do I Connect MySQL Database Via MySQL Workbench?<\/strong><\/a><\/p><hr>\n\n\n\n<h3 class=\"wp-block-heading\">\u27a2 <strong>Method 3: Using cPanel (phpMyAdmin)<\/strong><\/h3>\n\n\n\n<p>cPanel provides a user-friendly way to manage databases using phpMyAdmin. This method is ideal for beginners or website owners who use shared or VPS hosting and need a simple interface.<\/p>\n\n\n\n<p>\u2794 Log into cPanel<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"405\" height=\"383\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Cpanel-login.png\" alt=\"Cpanel login\" class=\"wp-image-2586\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Cpanel-login.png 405w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Cpanel-login-300x284.png 300w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 Once logged in, scroll down to the <strong>\u2018Databases\u2019<\/strong> section and click on <strong>\u2018phpMyAdmin.\u2019<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"688\" height=\"179\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Select-phpmyadmin-from-database.png\" alt=\"Select phpmyadmin from database\" class=\"wp-image-2587\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Select-phpmyadmin-from-database.png 688w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Select-phpmyadmin-from-database-300x78.png 300w\" sizes=\"auto, (max-width: 688px) 100vw, 688px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 In phpMyAdmin, find and select your database from the left panel.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"244\" height=\"341\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Select-database-from-left-panel.png\" alt=\"Select database from left panel\" class=\"wp-image-2588\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Select-database-from-left-panel.png 244w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Select-database-from-left-panel-215x300.png 215w\" sizes=\"auto, (max-width: 244px) 100vw, 244px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 To create a table, click on the<strong> \u2018Structure\u2019<\/strong> tab.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"455\" height=\"40\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-structure-to-create-table.png\" alt=\"Click on structure to create table\" class=\"wp-image-2589\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-structure-to-create-table.png 455w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-structure-to-create-table-300x26.png 300w\" sizes=\"auto, (max-width: 455px) 100vw, 455px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 Under the <strong>\u2018Create Table\u2019<\/strong> section, you have to enter the table name (e.g., <strong>New Users<\/strong>).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"494\" height=\"134\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-table-name-phpmyadmin.png\" alt=\"Enter table name - phpmyadmin\" class=\"wp-image-2591\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-table-name-phpmyadmin.png 494w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-table-name-phpmyadmin-300x81.png 300w\" sizes=\"auto, (max-width: 494px) 100vw, 494px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 In that, you have to define the number of columns (e.g., <strong>5<\/strong>).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"488\" height=\"128\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-number-of-columns.png\" alt=\"Enter number of columns\" class=\"wp-image-2592\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-number-of-columns.png 488w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Enter-number-of-columns-300x79.png 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 Once you define the number of columns, click <strong>\u2018Create.\u2019<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"504\" height=\"137\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-create-table-phpmyadmin-1.png\" alt=\"Click on create table - phpmyadmin\" class=\"wp-image-2593\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-create-table-phpmyadmin-1.png 504w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-create-table-phpmyadmin-1-300x82.png 300w\" sizes=\"auto, (max-width: 504px) 100vw, 504px\" \/><\/figure>\n<\/div>\n\n\n<p>\u2794 Now, you have to define table columns, for each column, you have to specify:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Name (e.g., ID, Name, Email, Age, Signup_Date)<\/li>\n\n\n\n<li>Type (e.g., INT, VARCHAR(100), TIMESTAMP)<\/li>\n\n\n\n<li>Attributes (e.g., Primary Key, Auto Increment for ID)<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"258\" src=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Define-table-columns-1024x258.png\" alt=\"Define table columns\" class=\"wp-image-2594\" srcset=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Define-table-columns-1024x258.png 1024w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Define-table-columns-300x76.png 300w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Define-table-columns-768x194.png 768w, https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Define-table-columns.png 1359w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u2794 Once done, You have to click <strong>\u2018Save.\u2019<\/strong><\/p>\n\n\n\n<p>\u2794 After saving, you need to verify the table. To do this, go back to the phpMyAdmin main page.<\/p>\n\n\n\n<p>\u2794 In that, click on the <strong>\u2018Users\u2019<\/strong> table and select <strong>\u2018Browse\u2019<\/strong> to see its structure.<\/p>\n\n\n\n<hr><p><strong>Also Read: <\/strong><a href=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/374\/How-to-Change-MySQL-Database-User-Password-From-cPanel.html\"><strong>How to Change MySQL Database User Password From cPanel?<\/strong><\/a><\/p><hr>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>And there you have it! You now know how to create a table in MySQL using three different methods:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Command Line<\/li>\n\n\n\n<li>MySQL Workbench<\/li>\n\n\n\n<li>cPanel<\/li>\n<\/ul>\n\n\n\n<p>No matter which method you choose, creating tables is an essential step in organizing your database effectively.<\/p>\n\n\n\n<p>Start practising today, and soon, managing databases will feel like second nature!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL is a powerful database management system that helps store and organise data efficiently. But before storing any data, you need a structured place to keep it\u2014this is where tables come in! You have to think of a table as an Excel sheet with rows and columns. Each row holds a record, and each column [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[50],"tags":[],"class_list":["post-2579","post","type-post","status-publish","format-standard","hentry","category-website"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create a Table in MySQL?<\/title>\n<meta name=\"description\" content=\"Learn how to create a table in MySQL using Command Line, MySQL Workbench, and cPanel. Follow step-by-step instructions to organise your data efficiently.\" \/>\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.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Table in MySQL?\" \/>\n<meta property=\"og:description\" content=\"Learn how to create a table in MySQL using Command Line, MySQL Workbench, and cPanel. Follow step-by-step instructions to organise your data efficiently.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html\" \/>\n<meta property=\"og:site_name\" content=\"Host IT Smart Knowledge base\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-25T11:18:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-02T14:03:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png\" \/>\n\t<meta property=\"og:image:width\" content=\"634\" \/>\n\t<meta property=\"og:image:height\" content=\"506\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html\",\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html\",\"name\":\"How to Create a Table in MySQL?\",\"isPartOf\":{\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png\",\"datePublished\":\"2025-03-25T11:18:49+00:00\",\"dateModified\":\"2025-12-02T14:03:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108\"},\"description\":\"Learn how to create a table in MySQL using Command Line, MySQL Workbench, and cPanel. Follow step-by-step instructions to organise your data efficiently.\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html#primaryimage\",\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png\",\"contentUrl\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png\",\"width\":634,\"height\":506},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website\",\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/\",\"name\":\"Host IT Smart Knowledge base\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108\",\"name\":\"Admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g\",\"caption\":\"Admin\"},\"sameAs\":[\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/\"],\"url\":\"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a Table in MySQL?","description":"Learn how to create a table in MySQL using Command Line, MySQL Workbench, and cPanel. Follow step-by-step instructions to organise your data efficiently.","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.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html","og_locale":"en_US","og_type":"article","og_title":"How to Create a Table in MySQL?","og_description":"Learn how to create a table in MySQL using Command Line, MySQL Workbench, and cPanel. Follow step-by-step instructions to organise your data efficiently.","og_url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html","og_site_name":"Host IT Smart Knowledge base","article_published_time":"2025-03-25T11:18:49+00:00","article_modified_time":"2025-12-02T14:03:25+00:00","og_image":[{"width":634,"height":506,"url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png","type":"image\/png"}],"author":"Admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Admin","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html","url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html","name":"How to Create a Table in MySQL?","isPartOf":{"@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html#primaryimage"},"image":{"@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html#primaryimage"},"thumbnailUrl":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png","datePublished":"2025-03-25T11:18:49+00:00","dateModified":"2025-12-02T14:03:25+00:00","author":{"@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108"},"description":"Learn how to create a table in MySQL using Command Line, MySQL Workbench, and cPanel. Follow step-by-step instructions to organise your data efficiently.","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/442\/how-to-create-table-in-mysql.html#primaryimage","url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png","contentUrl":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-content\/uploads\/2025\/03\/Click-on-schemas-tab.png","width":634,"height":506},{"@type":"WebSite","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#website","url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/","name":"Host IT Smart Knowledge base","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/317c14a877385667f19d3b7496bd5108","name":"Admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d4827c56a6721070dde339640d47ff44ba0d0e515c7e577cf29305ab72383fe3?s=96&d=mm&r=g","caption":"Admin"},"sameAs":["https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/"],"url":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/2579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2579"}],"version-history":[{"count":7,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/2579\/revisions"}],"predecessor-version":[{"id":3799,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/posts\/2579\/revisions\/3799"}],"wp:attachment":[{"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostitsmart.com\/manage\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}