H I O X INDIA
MySQL Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Mysql Tutorial
Introduction
How to Install
Database
Datatypes
Tables
INSERT
SELECT
UPDATE
DELETE
Operators
Functions
Ask Your Doubts
Feedback





Inserting row into a Database


Topic

How to insert multiple rows into a table?



Explanation

INSERT STATEMENT FOR MULTIPLE ROWS :

    We can insert multiple rows into a table using a single INSERT statement.

The Syntax is

INSERT INTO tbl_name(col_name1, col_name2,...) VALUES(expr1, expr2,.....;), (expr1a, expr2a,.....;)

Example :

mysql> insert into student(studid,name,marks,address,phone) 
values(3,'michael',75,'edinburgh',2598234),
(4,'jack',82,'victoria street',2436821),
(5,'anne',100,'downing street',2634821);
Query OK, 3 rows affected (0.00 sec)
Records: 3  Duplicates: 0  Warnings: 0 
    The above query will insert the three students details into the table student. This query will be useful while inserting large amount data into a specific table.



others


        MySQL is the most popular open source database Management system. Being a open source anyone can use and change the software for their needs. Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this MySQL tutorial. This is a copyright content.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links