INSERT statement - Definition - Oracle Tables

Q.  Which method enables you to add rows to a table, either by specifying the column values or by specifying a subquery that selects data from another existing table?
- Published on 12 Aug 15

a. INSERT statement
b. MERGE statement
c. Both A & B
d. None of the above

ANSWER: INSERT statement
 

    Discussion

  • Nirja Shah   -Posted on 01 Sep 15
    - MERGE statement - It is used to select rows from one or more sources for update or insertion into a table or view.
    - You can specify conditions to determine whether to update or insert into the target table or view.

    - INSERT statement - It enables you to add rows to a table, either by specifying the column values or by specifying a subquery that selects data from another existing table.

    - The syntax for the Oracle INSERT statement when inserting a single record using the VALUES keyword is:

    INSERT INTO table
    (column1, column2, ... column_n )
    VALUES
    (expression1, expression2, ... expression_n );

    - Or the syntax for the Oracle INSERT statement when inserting multiple records using a SELECT statement is:

    INSERT INTO table
    (column1, column2, ... column_n )
    SELECT expression1, expression2, ... expression_n
    FROM source_table
    WHERE conditions;

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)