课程: SQL Queries Made Easy

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Modify rows and columns in tables

Modify rows and columns in tables - SQL教程

课程: SQL Queries Made Easy

Modify rows and columns in tables

- [Instructor] In this video, we will learn about Update Statement. It's a DML statement. We use this to modify data in tables. This is the syntax. Here, the WHERE clause is not mandatory. If the, WHERE clause is specified, only those rows satisfying the condition will be modified. Otherwise all the rows will be modified. Let's take an example to modify one row in our emp table. First of all, let's look at it. SELECT* FROM emp_tab: run this. Now I want to modify the salary of this employee to 8,000. So I give UPDATE emp_tab SET salary=8,000 WHERE empno-7001: I'm using employee number here in our WHERE clause because that is unique for every employee. I could give the name, but name is not unique for every employee, but employee number would be unique. So that's the reason why I'm taking that. So only one row is updated, which is good. Let's take a look at the table now. This is the row that we updated to 8,000. Be…

内容