MYSQL08: Deleting a record
Now the last operation delete is written like this:
DELETE FROM tableName
This will delete all the records in the table leaving an
empty table. To delete only a single row, the WHERE clause is added at the back
of the delete SQL statement.
DELETE FROM tableName WHERE field =
value;
for example, to delete record about Calvin from the students
table:
DELETE FROM students WHERE name =
‘Calvin’;
Now, SELECT * FROM students will
return:
Id
|
name
|
age
|
2
|
Jamie
|
15
|
3
|
Rosy
|
17
|
Comments
Post a Comment