91-9990449935 0120-4256464 |
MySQL INSERT StatementMySQL INSERT statement is used to insert data in MySQL table within the database. We can insert single or multiple records using a single query in MySQL. Syntax: The SQL INSERT INTO command is used to insert data in MySQL table. Following is a generic syntax: Field name is optional. If you want to specify partial values, field name is mandatory.Syntax for all fields: MySQL INSERT Example 1: for all fieldsIf you have to store all the field values, either specify all field name or don't specify any field. Example: Or, MySQL INSERT Example 2: for partial fieldsIn such case, it is mandatory to specify field names. MySQL INSERT Example 3: inserting multiple recordsHere, we are going to insert record in the "cus_tbl" table of "customers" database. Visual Representation: See the data within the table by using the SELECT command:
Next TopicMySQL Update Query
|