ORACLE
ORACLE QUERIES
SELECT
INSERT
INSERT ALL
UPDATE
DELETE
TRUNCATE TABLE
ORACLE TUTORIAL
Oracle Introduction
What Is Oracle
ORACLE TABLES
Create Tables
Create Table As
Alter Table
Drop Table
Global Temorary Tables
Local Temorary Tables
ORACLE VIEWS
Create View
ORACLE CLAUSES
DISTINCT
FROM
ORDER BY
GROUP BY
HAVING
ORACLE OPERATORS
UNION
UNION ALL
INTERSECT
MINUS
ORACLE JOINS
INNER JOIN
OUTER JOIN
EQUI JOIN
SELF JOIN
CROSS JOIN
ANTI JOIN
SEMI JOIN
ORACLE ADVANCE
PROCEDURES
FUNCTION
CURSOR
TRIGGER

UPDATE



Oracle - Update


In Oracle, UPDATE query is used to update the existing records in a table.we can update a table in 2 ways.


Traditional Update table method :


Syntax:
UPDATE table  
SET column1 = expression1,  
    column2 = expression2,  
    ...  
    column_n = expression_n  
WHERE conditions;  

Update Table by selecting rocords from another table :


Syntax :
UPDATE table1  
SET column1 = (SELECT expression1  
               FROM table2  
               WHERE conditions)  
WHERE conditions;   

Parameters :


  • column1, column2, ... column_n : It specifies the columns that you want to update.

  • expression1, expression2, ...expression_n : This specifies the values to assign to the column1, column2, ... column_n.

  • conditions:It specifies the conditions that must be fulfilled for execution of UPDATE statement.


    Oracle Update Example: (Update single column)


    UPDATE suppliers  
    SET supplier_name = 'Kingfisher'  
    WHERE supplier_id = 2;  
    

    This example will update the supplier_name as "Kingfisher" where "supplier_id" is 2.


    Oracle Update Example: (Update multiple columns)


    The following example specifies how to update multiple columns in a table. In this example, two columns supplier_name and supplier_address is updated by a single statement.

    UPDATE suppliers  
    SET supplier_address = 'Agra',  
        supplier_name = 'Bata shoes'  
    WHERE supplier_id = 1; 
    

    Output:
    1 row(s) updated.
    0.06 seconds
    

    Oracle Update Example: (By selecting records from another table)


    UPDATE customers  
    SET name = (SELECT supplier_name  
                     FROM suppliers  
                     WHERE suppliers.supplier_name = customers.name)  
    WHERE age < 25;  
    

    Output:
    2 row(s) updated.
    0.02 seconds
    

    Here, the customers table is updated by fetching the data from "suppliers" table.



    What Is Oracle

    What Is Oracle

    posted on 2019-11-29 01:11:21 - ORACLE Tutorials


    TRIGGER

    ORACLE - Trigger

    posted on 2019-11-28 22:14:22 - ORACLE Tutorials


    CURSOR

    ORACLE - Cursor

    posted on 2019-11-28 22:13:54 - ORACLE Tutorials


    MySQL TRIGGERS

    MySQL - Triggers

    posted on 2019-11-29 21:44:07 - mysql Tutorials


    Grant_ Revoke Privilege

    MySQL - Grant_ Revoke Privilege

    posted on 2019-11-26 23:15:04 - mysql Tutorials


    MySQL Vs SQL

    MySQL Vs SQL

    posted on 2019-11-25 05:02:26 - mysql Tutorials