डाउनलोड पी.डी.एफ. ई-बुक्स
SQL - DELETE Statement

DELETE Statement से table से मौजुदे record या पूरे table के records को delete/remove किया जाता है |

Syntax for DELETE Statement in Python

For Specific Record
DELETE FROM table_name
WHERE condition;

For All Records
DELETE FROM table_name;
or
DELETE * FROM table_name;

Sample Table

+--------+---------------+------------+
| emp_id | emp_name      | emp_salary |
+--------+---------------+------------+
|      1 | Shweta Pandit |      30000 |
|      3 | Rupal Patil   |      30000 |
|      4 | Shankar Mane  |      15000 |
|     12 | Raj Mehra     |      10000 |
|     15 | Ramesh Mohane |      30000 |
|     20 | Rahul Kapoor  |      27000 |
+--------+---------------+------------+

Example for DELETE Statement with WHERE Clause in SQL

Example में Employee इस table में जहा पर emp_name 'Raj Mehra' है वो record table से delete किया गया है |

Source Code :
DELETE FROM Employee
WHERE emp_name='Raj Mehra';

SELECT * FROM Employee;
Output :
+--------+---------------+------------+
| emp_id | emp_name      | emp_salary |
+--------+---------------+------------+
|      1 | Shweta Pandit |      30000 |
|      3 | Rupal Patil   |      30000 |
|      4 | Shankar Mane  |      15000 |
|     15 | Ramesh Mohane |      30000 |
|     20 | Rahul Kapoor  |      27000 |
+--------+---------------+------------+

DELETE All Records From Table 'Employee'

Source Code :
DELETE FROM Employee;

SELECT * FROM Employee;
Output :
+--------+---------------+------------+
| emp_id | emp_name      | emp_salary |
+--------+---------------+------------+
+--------+---------------+------------+