From the course: SQL Queries Made Easy

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Modify rows and columns in tables

Modify rows and columns in tables - SQL Tutorial

From the course: SQL Queries Made Easy

Start my 1-month free trial

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…

Contents