INSERT
Statement:The INSERT
statement is used to add new records (rows) to a table in a database.
sqlCopy code
INSERT INTO employees (employee_id, employee_name, department_id, salary)
VALUES (101, 'John Doe', 1, 55000);
employees
table.sqlCopy code
INSERT INTO employees (employee_id, employee_name, department_id, salary)
VALUES
(102, 'Jane Smith', 2, 60000),
(103, 'Bob Johnson', 1, 58000);
employees
table in a single INSERT
statement.UPDATE
Statement:The UPDATE
statement is used to modify existing records in a table.
sqlCopy code
UPDATE employees
SET salary = 62000
WHERE employee_id = 102;
salary
of a single employee with employee_id
equal to 102 in the employees
table.sqlCopy code
UPDATE employees
SET department_id = 3
WHERE department_id = 1;
department_id
for multiple employees in the employees
table.WHERE
clause specifies the condition for selecting the records to be updated.DELETE
Statement: