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

SQL DELETE Statement-How to Delete Data in SQL Table

SQL TUTORIALS-

SQL DELETE Statement

Introduction-


Trulli Trulli

-✅ DELETE statement in SQL is used to remove one or more rows from a table based on a condition...

✅ 1-Basic syntax is Follow:-


DELETE FROM table_name
WHERE condition;



✅ table_name: The name of the table from which you want to delete data.

✅ condition: A filter to select which rows should be deleted.


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: Delete a single row:-


DELETE FROM Employees
WHERE EmployeeID = 2;



This deletes the employee with ID 2 from the Employees table.

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees


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

✅ Example 3: Delete all rows:-

Delete Query :-


DELETE FROM Customers;


Deletes all records from the Customers table.

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary

Example 4: Delete Based on a Condition:-

Delete Query :-


DELETE FROM Employees
WHERE Department = 'HR';


Deletes all employees who belong to the HR department.

Result Show :-

Emoji Examples in HTML

🔸 Example Table: Employees

ID Name Department Salary
1 ANNI IT 8000
2 POOJA IT 62000

May Be Like Important Link-

-Chart Of Account-OB13

-Define Plant-OX1

-Chart Of Account-OB13

-Define Financial Statement