Learn How to Delete Data Rows using Delete Statement in SQL

preview_player
Показать описание
In this lecture we will learn about using DELETE statement in SQL. As the name suggests DELETE statement is used to delete the data rows in a table. The DELETE statement can delete one or multiple data rows from a table. WHERE clause is used to specify the data row to be deleted. DELETE statement without WHERE clause will delete all the data rows in the table.
Here are the examples DELETE statements,
DELETE FROM tablename;
DELETE FROM tablename WHERE column1 = value;

Select the "school" database, "USE school;"
Run a simple SQL statement to display all the data rows in students2 table using SQL statement, "SELECT * FROM students2;"
Currently the 'students2' table have 58 data rows. Lets delete a data record having studentid 6;
The SQL statement will be, "DELETE FROM students2 WHERE studentid = 6;"
Now if we run the SQL statement again to display all the data rows in 'students2' table, "ELECT * FROM students2;"
You can see the studentid 6 is gone. and total data rows are 57.

Check out the whole playlist of SQL Tutorials or Individual video from the following links,

SQL Tutorial for Beginners. Introduction to SQL Basics

1.Learn What is SQL? Introduction to SQL

2.Learn How to Install MySQL Database Server on Windows Operating System

3.Learn What is Database? How to Create and Show Databases using SQL

4.Learn How to Select and Use Existing Database using SQL

5.Learn How to Delete or Remove Database using SQL

6.Learn What is Database Table? How to Create a Database Table using SQL?

7.Learn How to Modify or Update Database Table using SQL

8.Learn How to Delete or Remove Database Table using SQL

9.Learn How to Add Data Rows in a Table using SQL

10.Learn How to Use INSERT INTO SELECT Statement in SQL

11.Learn How to Update Data Rows using Update Statement in SQL

12.Learn How to Delete Data Rows using Delete Statement in SQL

Рекомендации по теме
Комментарии
Автор

Thankyou sir it's very very helpful.😃

s.sanjay.
Автор

how to delete one or more rows in table in sql server. For eample, 60, 61, 62, and 65 to be deleted? How?

findthetruth
Автор

alter table employee drop column COMP_ID;
this syntax is not working

vijendrabijalwan