how to create table in MySQL database?

Himmat Kumar Nov 12, 2024, 9:26 AM
MySQL
Views 209
Blog Thumbnail

Create table using SQL Query in MySQL

Create table in my sql database using SQL Query in MySQL

Steps:

  1. Open phpMyAdmin in your system.
  2. Click on the SQL tab.
  3. Paste the query

    CREATE TABLE students (
    studentID int,
    Name varchar(255),
    Email varchar(255),
    Class int,
    Section int
    );

  4. how to create table in mysql database
  5. Click the "Go" button.
  6. You should see a success message.
  7. Refresh the page to check if the Table is created successfully.
  8. how to create table in mysql database

Syntax

CREATE TABLE tablename (
column1 datatype,
column2 datatype,
column3 datatype,
column5 datatype,
column4 datatype,
.....
);

Note : In table name not allow " " space in beetween name use "_" for space.
column1 to column4 is coloum name you can modify and name give you according requirement.
datatype data type basically define a type of column . Example column1 is int show store integer value.

Example of Craete a tabLe in MySQL:

You Can follow statement and create table in Mysql

CREATE TABLE students (
studentID int,
Name varchar(255),
Email varchar(255),
Class int,
Section int
);

when run this statement in sql create a table in your database.
Like studentID, Class, Section datatype is Int this column hold integer value same like Name, Email column datatype is varchar hold character and max-lengh is 255.

Your Student table Looks Like this :
how to create table in mysql database

Comments

Please login to leave a comment.

No comments yet.

Related Posts

what-is-mysql-database
121 viewsMySQL
Himmat Kumar Nov 7, 2024, 4:40 AM

What is MySQL database?

how-to-create-database-in-MySQL
97 viewsMySQL
Himmat Kumar Nov 7, 2024, 7:46 AM

How to create database in MySQL

how-to-drop-database-in-mysql
105 viewsMySQL
Himmat Kumar Nov 12, 2024, 2:56 AM

How to drop database in MySQL ?

how-to-drop-table-in-mysql-database
173 viewsMySQL
Himmat Kumar Nov 25, 2024, 8:29 AM

how to drop table in MySQL database

chatgpt-outage-june-2025
1405 viewsTechnology
Himmat Regar Jun 10, 2025, 5:25 PM

ChatGPT Outage Today: What Happened & How OpenAI Is Fix...

colombia-vs-argentina-comparison
1456 viewsMarketing
Himmat Regar Jun 10, 2025, 5:47 PM

Colombia vs Argentina: Economy, Tourism & Lifestyle Fac...

best-courses-after-12th-science-commerce-arts-2025
436 viewsCareer
Himmat Regar Jun 16, 2025, 6:01 PM

Best Courses After 12th (Science, Commerce, Arts)

fast-track-ai-developer-2025
440 viewsCareer
Himmat Regar Jun 16, 2025, 6:16 PM

Fast-Track to AI Developer in 2025 — 12-Month Roadmap &...

rohit-sharma-complete-career-records-2025
434 viewsSports
Himmat Regar Jun 16, 2025, 6:31 PM

Rohit Sharma’s Complete Legacy (2007-2025): Every Recor...