Best Training on Sequel

How to delete a record in a table using SQL?

The SQL DELETE Query is used to delete the existing records from a table.

You can use WHERE clause with DELETE query to delete selected rows, otherwise all the records would be deleted.

Syntax:
The basic syntax of DELETE query with WHERE clause is as follows:

DELETE FROM table_name
WHERE [condition];

Example:
Consider the CUSTOMERS table having the following records:
+—-+———-+—–+———–+———-+
| ID | NAME | AGE | ADDRESS | SALARY |
+—-+———-+—–+———–+———-+
| 1 | Ramesh | 32 | Ahmedabad | 2000.00 |
| 2 | Khilan | 25 | Delhi | 1500.00 |
| 3 | kaushik | 23 | Kota | 2000.00 |
| 4 | Chaitali | 25 | Mumbai | 6500.00 |
| 5 | Hardik | 27 | Bhopal | 8500.00 |
| 6 | Komal | 22 | MP | 4500.00 |
| 7 | Muffy | 24 | Indore | 10000.00 |

Following is an example, which would DELETE a customer, whose ID is 6:

DELETE FROM CUSTOMERS
WHERE ID = 6;

If you want to DELETE all the records from CUSTOMERS table, you do not need to use WHERE clause and DELETE query would be as follows:

DELETE FROM CUSTOMERS;

SQL School is rated the BEST Training Center for SQL Server and MSBI

https://www.google.co.in/?gfe_rd=cr&ei=OnhhVZfHG6_v8wequYHAAQ&gws_rd=ssl#q=sql+school

https://www.google.co.in/?gfe_rd=cr&ei=OnhhVZfHG6_v8wequYHAAQ&gws_rd=ssl#q=sql+school

 

SQL School Training Institute (www.sqlschool) offers you complete practical real-time trainings.

Courses Offered:
1. SQL Server Developer Course (http://sqlschool.com/TSQL-Online-Training.html)
2. SQL DBA Course (http://sqlschool.com/SQLDBA-Online-Training.html)
3. MSBI Course (http://sqlschool.com/MSBI-Online-Training.html)
4. SSIS Course (http://sqlschool.com/SSIS-Online-Training.html)
5. SSAS Course (http://sqlschool.com/SSAS-Online-Training.html)
6. SSRS Course (http://sqlschool.com/SSRS-Online-Training.html)

To register for free demo:
http://sqlschool.com/contact.html

Call Us:
Mail: contact@sqlschool.com
Skype: SQL School
USA (001): (510) 400 – 4845
India (0091): 9666440801

SQL Server (T-SQL) and SQL Server DBA

Free Demo on : SQL Server (T-SQL) and SQL Server DBA

To Register Click Here

https://global.gotowebinar.com/manageWebinar.tmpl?webinar=581977366357493506

For Course Details and Curriculum please refer:
http://sqlschool.com/TSQL-Online-Training.html

and

http://sqlschool.com/SQLDBA-Online-Training.html

Check for Other Courses offered at SQL School:

http://sqlschool.com/courses.html

 

www.sqlschool.com

www.sqlschool.com

 

To Register Click Here

 

SQL School

Mail: contact@sqlschool.com

Skype: SQL School

Address/Map

 USA: +1 (510) 400 – 4845

India: +91 (040) 64577244 / 66343536 (Off)
India: +91 09666440801 (Mob)