Home DBMS SQL PL/SQL SQLite MongoDB Cassandra MySQL Oracle CouchDB Neo4j DB2 C Java Projects Interview Q
⇧ SCROLL TO TOP
SQL DELETE Statement
The SQL DELETE statement is used to delete rows from a table. Generally, DELETE statement
removes one or more records form a table.
Syntax
DELETE FROM table_name WHERE some_condition;
Sample Table
EMPLOYEE
ADVERTISEMENT
ADVERTISEMENT
EMP_ID EMP_NAME CITY SALARY AGE
1 Angelina Chicago 200000 30
2 Robert Austin 300000 26
3 Christian Denver 100000 42
4 Kristen Washington 500000 29
5 Russell Los angels 200000 36
6 Marry Canada 600000 48
Deleting Single Record
Delete the row from the table EMPLOYEE where EMP_NAME = 'Kristen'. This will delete only the
fourth row.
Query
DELETE FROM EMPLOYEE
WHERE EMP_NAME = 'Kristen';
Output: After executing this query, the EMPLOYEE table will look like:
EMP_ID EMP_NAME CITY SALARY AGE
1 Angelina Chicago 200000 30
2 Robert Austin 300000 26
3 Christian Denver 100000 42
5 Russell Los angels 200000 36
6 Marry Canada 600000 48
Deleting Multiple Record
Delete the row from the EMPLOYEE table where AGE is 30. This will delete two rows(first and
third row).
Query
DELETE FROM EMPLOYEE WHERE AGE= 30;
Output: After executing this query, the EMPLOYEE table will look like:
EMP_ID EMP_NAME CITY SALARY AGE
2 Robert Austin 300000 26
3 Christian Denver 100000 42
5 Russell Los angels 200000 36
6 Marry Canada 600000 48
Delete all of the records
Delete all the row from the EMPLOYEE table. After this, no records left to display. The
EMPLOYEE table will become empty.
Syntax
DELETE * FROM table_name;
or
DELETE FROM table_name;
Query
DELETE FROM EMPLOYEE;
Output: After executing this query, the EMPLOYEE table will look like:
EMP_ID EMP_NAME CITY SALARY AGE
Note: Using the condition in the WHERE clause, we can delete single as well as multiple records. If
you want to delete all the records from the table, then you don't need to use the WHERE clause.
Ad
AACSB-accredited MBA
University of Adelaide Apply Now
← Prev Next →
For Videos Join Our Youtube Channel: Join Now
Feedback
Help Others, Please Share
Simple & Easy-To-Use
CommCare Data Collection
Leading Data Collection, Monitoring and
Reporting Solution for Social Impact
Programs.
dimagi.com
OPEN
Learn Latest Tutorials
Splunk SPSS tutorial Swagger T-SQL Tumblr
tutorial SPSS
tutorial tutorial tutorial
Splunk Swagger Transact-SQL Tumblr
React tutorial Regex R RxJS tutorial
tutorial Reinforcement Programming
ReactJS RxJS
learning tutorial
Regex
tutorial
R Programming
Reinforcement
Learning
React Native Python Python Python Keras
tutorial Design Patterns Pillow tutorial Turtle tutorial tutorial
React Native Python Design Python Pillow Python Turtle Keras
Patterns
Preparation
Aptitude Logical Verbal Interview Company
Aptitude
Reasoning Ability Questions Interview
Reasoning Verbal Ability Interview
Questions
Questions Company
Questions
Trending Technologies
Artificial AWS Tutorial Selenium Cloud Hadoop
Intelligence AWS
tutorial Computing tutorial
Artificial Selenium Cloud Computing Hadoop
Intelligence
ReactJS Data Science Angular 7 Blockchain Git Tutorial
Tutorial Tutorial Tutorial Tutorial Git
ReactJS Data Science Angular 7 Blockchain
Machine DevOps
Learning Tutorial
Tutorial DevOps
Machine
Learning
B.Tech / MCA
DBMS Data DAA tutorial Operating Computer
tutorial Structures DAA
System Network
DBMS
tutorial Operating
tutorial
Data Structures System Computer
Network
Compiler Computer Discrete Ethical Computer
Design tutorial Organization Mathematics Hacking Graphics
and Tutorial Tutorial
Compiler Design Ethical Hacking
Architecture Discrete Computer
Computer Mathematics Graphics
Organization
Software html tutorial Cyber Automata C Language
Engineering Web Technology
Security Tutorial tutorial
Software
tutorial Automata C Programming
Engineering Cyber Security
C++ tutorial Java tutorial .Net Python List of
C++ Java
Framework tutorial Programs
tutorial Python Programs
.Net
Control Data Mining Data
Systems Tutorial Warehouse
tutorial Data Mining
Tutorial
Control System Data Warehouse