SQL Delete Command

Advertisements

Alter Command in SQL Update Command in SQL

SQL Delete Command

Delete command is used to delete the record from the table.

  • Using Delete command you can delete all the records from the table without delete table.
  • Using Delete command you can delete specific records from the table "using where clause"

Syntax

	
DELETE FROM table_name
WHERE some_column=some_value;

Employee table

emp_idnamesalary
101Amit24000
102Rahul34000
103Sultan54000
104Gaurav26000
105Hitesh35000

Example

DELETE FROM Employee
WHERE salary<30000;

Result after Execute above query.

emp_idnamesalary
102Rahul34000
103Sultan54000
105Hitesh35000

Difference between truncate and delete

TruncateDelete
1It is DDL CommandIt is DML Command
2It is used for permanent deletion.It is used for temporary deletion.
3We can not delete the specific record.We can delete the specific records.

Delete all record

You can also delete all the record from a table without deleting table.

Syntax

	
DELETE FROM table_name
or
DELETE * FROM table_name;

Example

DELETE FROM Employee
emp_idnamesalary
   

Alter Command in SQL Update Command in SQL

Advertisements

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Pure VPN Privide Lowest Price VPN Just @ $1.65. Per Month with Non Detected IP Lowest Price Non Detected IP VPN

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements