How to Insert Data Into The Table in MySql

How to insert data into the table in mysql - A table in the mysql database will certainly be populated with a record or data. But do you know how to insert data into the table in mysql ?. In this post I will share about tutorial how to insert  record or data into table in mysql. Before I give this tutorial you must have mastered the following tutorial:
The general form of SQL commands to add records or data to a table is as follows:
INSERT INTO table_name VALUES (‘value1’,’ value2’,...); INSERT INTO table_name VALUES (‘value1’,’value2’,...);
Or can be in the form as follows:
INSERT INTO table_name (field1,field2,...) VALUES (‘value1’,’value2’,...);
Or it can be with the following form:
INSERT INTO table_name SET field1=’value1’, field2=’value2’,...;
For example, we will add a record to the student table we created earlier. Here is the SQL command to add a record to the student table:
INSERT INTO student VALUES ('201051162','Johans Komp', '1991-10-25','Jakarta');
If the above SQL command is executed then the message will display as follows:
Query OK, 1 row affected (0.05 sec)
How to Insert Data Into The Table in MySql

After the above SQL command is executed, the record or data in the student table will increase. Run the following command to view the contents of the student table!
SELECT * FROM student;
And here are the results of the above SQL command:
How to Insert Data Into The Table in MySql

That's the tutorial we can share about: how to insert data into the table in mysql. Hopefully the article on this php programming language blog can help you all.

Comments