DELETE

When you need to remove a row from a table, use the DELETE command. Its syntax is similar to the SELECT command and allows you to narrow down the exact row or rows to delete using qualifiers such as WHERE and LIMIT.

Now that you’ve seen the effects of the DISTINCT qualifier, you should remove 30 suosikkia by entering the commands in

you should remove 30 suosikkia by entering the commands in

DELETE FROM classics WHERE title=’30 suosikkia’;

This example issues a DELETE command for all rows whose title column contains the string 30 suosikkia.

The WHERE keyword is very powerful, and important to enter correctly; an error could lead a command to the wrong rows (or have no effect in cases where nothing matches the WHERE clause). So now we’ll spend some time on that clause, which is the heart and soul of SQL 🙂


Leave a Reply

Your email address will not be published. Required fields are marked *