MySQL - Insert Query
Insert statement is used to insert new records in a table.
SYNTAX :
The INSERT INTO statement can be written in the following two ways-
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
--You need not mention the column names
INSERT INTO table_name
VALUES (value1, value2, value3, ...);
Example :
INSERT INTO studentrecord(StudentID, StudentName, ParentName, Address, City, PostalCode, Country)
VALUES ('01', 'Sanjoshi','Jagan', 'Banjara Hills', 'Hyderabad', '500046', 'India');
INSERT INTO studentrecord
VALUES ('02', 'Shivarii','Pranay', 'Hamel Street', 'Kolkata', '700096', 'India');
As a result,the following table with values inserted displays:
StudentID | StudentName | ParentName | Address | City | PostalCode | Country |
---|---|---|---|---|---|---|
01 | Sanjoshi | Jagan | Banjara Hills | Hyderabad | 500046 | India |
02 | Shivari | Pranay | Hamel Street | Kolkata | 700096 | India |
MySQL - Grant_ Revoke Privilege
posted on 2019-11-26 23:15:04 - mysql Tutorials