SQL
The INSERT INTO statement is used to insert new records in a table.
INSERT INTO
Syntax
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
VALUES (value1, value2, value3, ...);
Id | Student_Name | Gender | Home_Town |
---|---|---|---|
1 | Rahul | Male | Lucknow |
2 | Raj | Male | Varanasi |
3 | Ramu | Male | Lucknow |
Id | Student_Name | Gender | Home_Town |
---|---|---|---|
1 | Rahul | Male | Lucknow |
2 | Raj | Male | Varanasi |
3 | Ramu | Male | Lucknow |
4 | Rekha | Female | Delhi |
UPDATE
The UPDATE statement is used to modify the existing records in a table.
Syntax
UPDATE table_name SET column1 = value1, column2 = value2, ...
WHERE condition;
WHERE condition;
Id | Student_Name | Gender | Home_Town |
---|---|---|---|
1 | Rahul | Male | Lucknow |
2 | Raj | Male | Varanasi |
3 | Ramu | Male | Lucknow |
4 | Rekha | Female | Delhi |
Id | Student_Name | Gender | Home_Town |
---|---|---|---|
1 | Raju | Male | Jammu |
2 | Raj | Male | Varanasi |
3 | Ramu | Male | Lucknow |
4 | Rekha | Female | Delhi |