Home arrow Oracle arrow Page 5 - Oracle Database Fundamentals

Updating Data - Oracle

In this article we will mainly focus on basic database development using Oracle. We will learn how to create new tables, alter them, insert data into the database, update data, retrieve data, delete data and drop tables. We have lots to do, so let's get started.

TABLE OF CONTENTS:
  1. Oracle Database Fundamentals
  2. Creating Database Tables
  3. Inserting Data
  4. Selecting Data
  5. Updating Data
By: Mamun Zaman
Rating: starstarstarstarstar / 103
May 01, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

We can update a table using following statements.

update tablename set columnname=somevalue;

Or

update tablename set columnname=somevalue where conditions;

To update all the records use the first statement. To update particular records, add where conditions at the end of the update statements. To give an increment of 1000 to all our employees use:

update employee set salary=salary+1000;

update employee set salary=60000 where empid=1;

The above statement will change the salary of employee with empid 1 to 60000.

Deleting Data

Data from tables can be deleted using the following statements.

delete from tablename;

delete from tablename where conditions;

delete tablename;

delete tablename where conditions;

To delete the record of an employee with the first name Tim use:

delete from employee where "First Name"='Tim';

To delete all records from the employee table use:

delete employee;

Dropping a Table

To drop a table use:

drop table tablename;

To drop an employee table use:

drop table employee;

To commit changes in Oracle Database use commit and to roll back your changes use the rollback command.



 
 
>>> More Oracle Articles          >>> More By Mamun Zaman
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: