bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL DELETE Keyword

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind SQL DELETE Keyword?

Lesson checks

Practice each idea before moving on

Short Mimo-style checks built from this lesson's code, terms, and sequence.

1Quick choice

Which statement best captures the main point of this lesson?

2Fill blank

Complete the missing token from the example code.

DELETE ___ Customers
3Order

Put the learning moves in the order that makes the concept easiest to apply.

It is possible to delete all rows in a table without deleting the table.
The following SQL statement deletes the customer "Alfreds Futterkiste" from the "Customers" table:
The DELETE command is used to delete existing records in a table.

Delete

The DELETE command is used to delete existing records in a table.

The following SQL statement deletes the customer "Alfreds Futterkiste" from the "Customers" table:

Example

DELETE FROM Customers
 WHERE CustomerName='Alfreds Futterkiste';

Note

Be careful when deleting records in a table! Notice the WHERE clause in the DELETE statement. The WHERE clause specifies which record(s) should be deleted. If you omit the WHERE clause, all records in the table will be deleted!

It is possible to delete all rows in a table without deleting the table. This means that the table structure, attributes, and indexes will be intact:

The following SQL statement deletes all rows in the "Customers" table, without deleting the table. This means that the table structure, attributes, and indexes will be intact:

Example

DELETE FROM Customers;

Previous

SQL DEFAULT Keyword

Next

SQL DESC Keyword