Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Sql Sql-functions Mysql Multiple Date Insert

Related Tutorials


 
 

Share on Google+Share on Google+

Mysql Multiple Date Insert

Advertisement
Mysql Multiple Column Insert is used to add or insert multiple data to the table.

Mysql Multiple Date Insert

     

Mysql Multiple Column Insert is used to add or insert multiple data to the table.

Understand with Example

The Section of Tutorial illustrate an example from 'Mysql Multiple Column Insert'.To understand an example we  create a table 'Employee' with required fieldname and datatype respectively.

 

 

 

Query for creating table:

mysql> CREATE TABLE Employee(
    ->              Empid int(10),
    ->              Empname varchar(60),
    ->              Salary int(90),
    ->       DOB date
    ->            );
Query OK, 0 rows affected (0.01 sec)

Query for Multiple insertion of data in table:

The Query insert into is used for Multiple insertion of data in table 'Employee'.

The Query is used 

mysql>     INSERT INTO Employee (Empid,Empname,Salary,DOB) VALUES
    ->                                          (01,'Habib',2014,20041202),
    ->                                          (02,'Karan',4021,20030411),
    ->                                          (03,'Samia', 22,20080223),
    ->                                          (04,'Hui Ling', 25,20081015),
    ->                                          (05,'Yumie', 29,19990126);
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0


Query to view data inserted in table:

To view the records from table employee we use select query to retrieve the table 'employee'details. 

mysql> select * from employee;

Output:-

+-------+----------+--------+------------+
| Empid | Empname  | Salary | DOB        |
+-------+----------+--------+------------+
| 1     | Habib    | 2014   | 2004-12-02 |
| 2     | Karan    | 4021   | 2003-04-11 |
| 3     | Samia    | 22     | 2008-02-23 |
| 4     | Hui Ling | 25     | 2008-10-15 |
| 5     | Yumie    | 29     | 1999-01-26 |
+-------+----------+--------+------------+
5 rows in set (0.00 sec)
Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: January 16, 2009

Related Tutorials

Discuss: Mysql Multiple Date Insert  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com