How to import the Excel sheet data into MySql database

Hi, In this tutorial, I am going to explain  How to import the Excel sheet data into MySql database.

Some of the organizations are uses the Excel sheets to save their data. When they want to upgrade their system with new technologies. Then we need to convert the entire Excel sheets data into SQL format.

For example, consider the one of the major organization is school
In school, so many students records are stored in the Excel sheet. Now we would like to import all those Excel data into SQL. Generally, this can be achieved by using the ODBC connections using any programming language. But it is somewhat difficult.

I will explain How to import the Excel sheet data into MySql database in the simplest way.
There's a simple online tool that can do i.e sqlizer.io
Here You can upload an XLSX file to it, enter a sheet name, cell range, and database table name. Here student.xlsx contains the student's data i.e there in the Sheet1, cell range is A1:E11 and MySql database table name is student.


After providing this information whenever you press the Convert My File button. Then it will generate a CREATE TABLE statement and a bunch of INSERT statements.
CREATE TABLE student (
    `id` INT,
    `fullname` VARCHAR(13) CHARACTER SET utf8,
    `gender` VARCHAR(7) CHARACTER SET utf8,
    `mobilenumber` INT,
    `city` VARCHAR(6) CHARACTER SET utf8
);
INSERT INTO student VALUES (1,'M.Rajkumar','Male',9959950011,'Guntur');
INSERT INTO student VALUES (2,'Ch.Eswar','Male',9959950011,'Guntur');
INSERT INTO student VALUES (3,'M.Srikanth','Male',9959950011,'Guntur');
INSERT INTO student VALUES (4,'Syed. Rehaman','Male',9959950011,'Guntur');
INSERT INTO student VALUES (5,'N. Nagendra','Male',9959950011,'Guntur');
INSERT INTO student VALUES (6,'D.Naveen','Male',9959950011,'Guntur');
INSERT INTO student VALUES (7,'G.Manohar','Male',9959950011,'Guntur');
INSERT INTO student VALUES (8,'P.Mahalaxmi','Fe Male',9959950011,'Guntur');
INSERT INTO student VALUES (9,'V.Vasavi','Fe Male',9959950011,'Guntur');
INSERT INTO student VALUES (10,'P.Swapna','Fe Male',9959950011,'Guntur');
These statements are imported all your data into a MySQL database

Watch Demo
* If you like this post please don’t forget to subscribe Techies Badi - programming blog for more useful stuff


EmoticonEmoticon