HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
HTML Tutorial

CSS Tutorial

SQL delete row - SQL delete table


SQL DELETE Query is used to delete an existing records from a table.
With SQL DELETE Query you can use the WHERE clause to delete the selected rows, otherwise all the records would be deleted from database table.

SQL delete row - SQL delete table - how to create? - example


Syntax The basic syntax of the DELETE query with WHERE clause is;
DELETE FROM name_table
WHERE [condition];



Example 1:
ID Name Contact Address City
1

Jones Cruise Ana Maria Will Str. 57 Paris
2 Robert Caine Ana Trujillo Avda. Larga 24 Roma
3 Brad Bale Antonio mauro Mataderos 19 Madrid

DELETE FROM Customers WHERE Name='Jones Cruise';

DELETE: Delete the first customer (ID = 1).

ID Name Contact Address City
2 Robert Caine Ana Trujillo Avda. Larga 24 Roma
3 Brad Bale Antonio mauro Mataderos 19 Madrid


If you want to DELETE all the records from the CUSTOMERS table in your database, you do not need to use the WHERE clause.

DELETE FROM Customers;

SQL statement from above deletes all rows in the - Customers - table, without deleting the table.

Note: Be careful when you are deleting records in a table!

sql delete, row, table, column, with join, table data, cascade, duplicates keep one, from multiple tables, rows in table, database SQL delete row - SQL delete table - sql tutorial

2572. SQL GROUP BY - SQL Tutorial

http://www.sql-tutorial.net/SQL-GROUP-BY.asp

2560. Disclaimer - SQL Tutorial

http://www.sql-tutorial.net/disclaimer.asp

2586. SQL SUM - SQL Tutorial

http://www.sql-tutorial.net/SQL-SUM.asp

1942. Online SQL Server Tutorial, Examples, Software, Commands, Online Courses
Online SQL Tutorial pdf, what is SQL, Online Courses, Classes, Training, Tutorials for Beginners - agernic.com is a free interactive Code, Tags, Example
http://www.agernic.com/sql-tutorial.html

3283. Insert into SQL - Insert into table SQL - Insert data in sql, sql tutorial
Insert into SQL - Insert into table SQL - Insert data in sql sql tutorial
https://www.agernic.com/sql-tutorial/insert-into-sql-insert-into-table-sql-data-in-sql.html

3228. SQL - Syntax, sql tutorial
SQL - Syntax sql tutorial
https://www.agernic.com/sql-tutorial/sql-syntax.html

Your add here
How to get PHP errors to display?
How to prevent sql injection in php mysqli
How do I get PHP errors to display - PHP error_reporting()
mysql_query(): The mysql extension is deprecated and will be removed i
Function eregi_replace() is deprecated in php - How to fix
PHP delete an element from an array
Uncaught Error: Call to undefined function MYSQL_NUM_ROWS() in
Deprecated: mysql_connect() mysql extension is deprecated and will be
mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean g
SQL IN Operator - example
SQL BETWEEN Operator
SQL like syntax and example
SQL WHERE AND & OR multiple conditions
SQL create table primary key autoincrement
PHP mysqli_connect () Function
SQL COUNT(), AVG() and SUM() Functions
Display data from SQL database with MySQLi into php - html table
SQL CREATE DATABASE - example
SQL mysql order by columns, by date, by asc, by desc, random with PHP
PHP mysqli_query() Function - mysqli query
SQL delete row - SQL delete table
SQL update - SQL update select
Insert into SQL - Insert into table SQL - Insert data in sql
Login in PHP - simple login script with PHP MYSQL