From the course: SQL Queries Made Easy
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Modify rows and columns in tables - SQL Tutorial
From the course: 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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.