"if you encounter any errors in SAP, send me a screenshot at pramod@learntosap.com, and I will help you resolve the issue."

SQL UPDATE Statement

SQL TUTORIALS-

SQL UPDATE Statement

Introduction-


Trulli Trulli

-🔍 SQL UPDATE statement is used to modify existing records in a table.

✅ 1-Basic syntax is Follow:-


UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;


Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ HR 5000

✅ Example 2: Update a single row:-


UPDATE Employees
SET Salary = 62000
WHERE ID = 2;


Row inserted → 2 | POOJA | IT | 62000

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees


ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 62000
3 RAJ HR 5000

✅ Example 2: Update multiple rows with a condition:-

UPDATE Query :-


UPDATE Employees
SET Salary = Salary + 2000
WHERE Department = 'HR';

Row inserted → Salary | HR | 2000

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 10000
2 POOJA IT 9000
3 RAJ HR 7000

Example 3: Update based on another column value:-

UPDATE Query :-


UPDATE Employees
SET Department = 'IT'
WHERE Salary > 8000;

Row inserted → | ANNI | IT | 8000

Row inserted → | POOJA | IT | 62000

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 8000
2 POOJA IT 62000
3 RAJ HR 7000

May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement