February 2014
Beginner
1248 pages
62h 25m
English
A SQL DELETE statement removes rows from a table. Its basic form is
DELETE FROM tableName WHERE criteria
where tableName is the table from which to delete. The optional WHERE clause specifies the criteria used to determine which rows to delete. If this clause is omitted, all the table’s rows are deleted. The DELETE statement
DELETE FROM Authors WHERE LastName = 'Black' AND FirstName = 'Sue'
deletes the row for Sue Black in the Authors table. If we know the AuthorID in advance of the DELETE operation, the WHERE clause can be simplified as follows:
WHERE AuthorID = 5
Figure 24.22 shows the Authors table after the DELETE operation has taken place.
Fig. ...
Read now
Unlock full access