🔥 $100K Hit! Where Will Bitcoin Go Next? Find Out Live!

Code has been added to clipboard!

SQL DELETE

Reading time 1 min
Published Aug 9, 2017
Updated Oct 9, 2019

TL;DR – SQL DELETE is an irreversible command which deletes data records from a table. To select specific records to delete, use the WHERE clause.

The syntax for SQL DELETE

Example
DELETE FROM mytable_name
WHERE condition;

Examples using a demo database

DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
edX
Pros
  • A wide range of learning programs
  • University-level courses
  • Easy to navigate
  • Verified certificates
  • Free learning track available
Main Features
  • University-level courses
  • Suitable for enterprises
  • Verified certificates of completion

The Developers table

ID Name City Country
1 Tom Kurkutis New York USA
2 Ana Fernandez London UK
3 Antonio Indigo Paris France
4 Aarav Kaelin Delhi India
5 Andrew Tumota Miami USA
6 Basma Zlata Miami USA

Deleting a single record

Example
DELETE FROM Developers
WHERE Name='Antonio Indigo';

The result

ID Name City Country
1 Tom Kurkutis New York USA
2 Ana Fernandez London UK
3 Aarav Kaelin Delhi India
4 Andrew Tumota Miami USA
5 Basma Zlata Miami USA

Deleting all the data but keeping the table

Example
DELETE * FROM Developers;