How to insert data into MySQL Table - MySQL Developer Tutorial

How to insert data into MySQL Table

To insert the data into MySQL Table, below syntax can be used.

insert into TableName
Values (ValueForColumn1,ValueforColumn2,....);


Let's say we want to create customer report and then insert a row into customer table. we can use below statements.

CREATE TABLE `customer` (
  `idcustomer` int(11) NOT NULL auto_increment,
  `firstname` varchar(50)  NULL,
  `lastname` varchar(30)  NULL,
  `age` int(11) DEFAULT NULL,
  `phonenumber` char(11) DEFAULT NULL,
  `dob` date DEFAULT NULL,
  `gender` char(1) NOT NULL,
  Constraint pk_idcustomer Primary key (idcustomer)
) ;

Insert a row in customer table.

insert into customer

Insert data into MySQL Table by using Insert statement - MySQL Tutorial