Delete Rows Cheat Sheet < Introduction to SQL

 

Concepts in Focus

Database The database consists of a

player
table that stores the details of players who are a part of a tournament.
player
table stores the name, age and score of players.

Delete Rows

DELETE
clause is used to delete existing records from a table.

Delete All Rows

Syntax

DELETE FROM
table_name;
SQL

Example

Delete all the rows from the

player
table.

DELETE FROM
player;
SQL

Delete Specific Rows

Syntax

DELETE FROM
table_name
WHERE
column1 = value1;
SQL

Example

Delete "Shyam" from the

player
table. Note: We can uniquely identify a player by name.

DELETE FROM
player
WHERE
name = "Shyam";
SQL
Warning
We can not retrieve the data once we delete the data from the table.

Drop Table

DROP
clause is used to delete a table from the database.

Syntax

DROP TABLE table_name;
SQL

Example

Delete

player
table from the database.

DROP TABLE player;

Post a Comment

Please Select Embedded Mode To Show The Comment System.*

Previous Post Next Post

Contact Form