Deleting entries from tables
The SQL delete statement requires the table name and optional conditions.
DELETE from table_name [WHERE conditions];
NOTE: If you don’t specify any conditions ALL THE DATA IN THE TABLE WILL BE DELETED!!!
One of the Multimedia specialists ‘Hasan Rajabi’ (employee id 10) leaves the company. We’ll delete his entry.
DELETE from employee_data WHERE emp_id = 10; Query OK, 1 row affected (0.00 sec)
|
« Previous
|
Next »
|
Dropping tables To remove all entries from the table we can issue the DELETE statement without any conditions. DELETE from employee_data; Query OK, 0 rows ...
SQL Tutorial What is SQL? The Structured Query Language is used in manipulating data stored in Relational Database Management Systems (RDBMS). SQL provides commands ...
Updating records The SQL UPDATE command updates the data in tables. Its format is quite simple. UPDATE table_name SET column_name1 = value1, column_name2 = value2, ...
Querying MySQL tables Our employee_data table now contains enough data for us to work with. Let us see how we can extract (query) it. Querying ...
Inserting data in MySQL tables Inserting data into tables The INSERT SQL statement impregnates our table with data. Here is a general form of INSERT. ...