SQL UPDATE statements

Here we will learn about the UPDATE statement in Oracle. What is the use of it and syntax for the same.

Introduction

UPDATE statement is used to update one or more record in DB table.

Syntax for UPDATE statement

UPDATE <table_name> SET <column_name>  =<value> WHERE <condition>

TABLE_NAME
Name of the table of which record is going to be updated.
COLUMN_NAME
Name of column in table to update.
VALUES
Value with which above column will be updated
CONDITION
Used to filter out the records to update in table.

UPDATE Statement Example

Dummy Table

We will use employee dummy table for our example. DDL(Data definition language) query for employee would be

create table employee(name varchar2(10), surName varchar(20), Address varchar2(40), phone number)

Dummy Data

For example purpose we will populate dummu table with some dummy data. Below is the query for the same.

Query 1

Update all record in employee table with phone number as “111111” where phone >

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.