课程: Hands-On Introduction: SQL
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Delete rows in a table
- [Instructor] In this video, we will learn about the DELETE statement. It is used to delete rows from a table. There are two approaches to delete rows. One is a simple WHERE condition. Just like other DML statements, if we give the WHERE condition, it's going to delete only specific rows which satisfy that criteria. Otherwise, all the rows in the tables will be deleted. So this is how we will give it, DELETE FROM table_name WHERE condition. The second approach is by using subqueries. When we want to delete rows based on another table, we use subqueries. Like, DELETE FROM table_name WHERE column name equals a subquery in the parenthesis. It need not be an equals to sign. It can be any other operators that we have learned earlier. So let's take a look at few examples for this. Let's go to chapter 02, video 04, Delete.sql. Click here and run the SELECT statement. So this is our table emp_tab. Now here, I'm trying…