Sql query option under Database command can be used to insert, update and delete the sql table
Answers
SQL command to insert onto a table:
Syntax: There are two ways to insert into a table:
INSERT INTO table_name (column1, column2, ……..)
VALUES (value1, value2, ……..);
Example: INSERT INTO student (roll_no, name, class)
VALUES (‘123’, ‘Rohit Jain’, ‘9’);
Or,
INSERT INTO table_name
VALUES (valuw1, value2, ……..);
Example: INSERT INTO student
VALUES (‘123’, ‘Rohit Jain’, ‘9’);
SQL command to update a record in a table:
Syntax:
UPDATE table_name
SET column1 = value1, column2 = value2, …..
WHERE condition;
Example:
UPDATE student
SET name = ‘Rohit Roy’, class = ‘8’
WHERE roll_no = ‘123’;
SQL command to delete a table:
Syntax to delete record from a table:
DELETE FROM table_name WHERE condition;
Example: DELETE FROM student class = ‘9’;
Syntax to delete the table:
DELETE table_name;
Example: DELETE student;