Answered Questions

  • Command to show SQL commands from buffer

    Which command displays the SQL command in the SQL buffer, and then executes it?

  • Explain kill() and its possible return values?

    There are four possible results from this call:‘kill()’ returns 0. This implies that a process exists with the given PID, and the system would allow you to send signals to it. It is system-dependent whether the process could be a zombie.‘kill()’ returns -1, ‘errno == ESRCH’ either no process exists with the given PID, or security  enhancements are causing the system to deny its existence. (On     some...

  • What is a join

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: NK

    • Jun 29th, 2005


    A join is a query that combines rows from two or more tables, views, or materialized views. Oracle performs a join whenever multiple tables appear in the query's FROM clause. The query's select list can select any columns from any of these tables. If any two of these tables have a column name in common, then you must qualify all references to these columns throughout the query with table names to avoid ambiguity. 
     
    Most join queries contain WHERE clause conditions that compare two columns, each from a different table. Such a condition is called a join condition. To execute a join, Oracle combines pairs of rows, each containing one row from each table, for which the join condition evaluates to TRUE. The columns in the join conditions need not also appear in the select list. 
     
    To execute a join of three or more tables, Oracle first joins two of the tables based on the join conditions comparing their columns and then joins the result to another table based on join conditions containing columns of the joined tables and the new table. Oracle continues this process until all tables are joined into the result. The optimizer determines the order in which Oracle joins tables based on the join conditions, indexes on the tables, and, in the case of the cost-based optimization approach, statistics for the tables. 
     

  • What is difference between TRUNCATE & DELETE

    Answer posted by Scott on 2005-05-25 18:30:04: TRUNCATE is a DDL command and cannot be rolled back. All of the memory space is released back to the server. DELETE is a DML command and can be rolled back.  Both commands accomplish identical tasks (removing all data from a table), but TRUNCATE is much faster.

    Star Read Best Answer

    Editorial / Best Answer

    Answered by: Prangya Sahu

    • Nov 21st, 2005


    1>TRUNCATE is a DDL command whereas DELETE is a DML command.

    2>TRUNCATE is much faster than DELETE.

    Reason:When you type DELETE.all the data get copied into the Rollback Tablespace first.then delete operation get performed.Thatswhy when you type ROLLBACK after deleting a table ,you can get back the data(The system get it for you from the Rollback Tablespace).All this process take time.But when you type TRUNCATE,it removes data directly without copying it into the Rollback Tablespace.Thatswhy TRUNCATE is faster.Once you Truncate you cann't get back the data.

    3>You cann't rollback in TRUNCATE but in DELETE you can rollback.TRUNCATE removes the record permanently.

    4>In case of TRUNCATE ,Trigger doesn't get fired.But in DML commands like DELETE .Trigger get fired.

    5>You cann't use conditions(WHERE clause) in TRUNCATE.But in DELETE you can write conditions using WHERE clause.

    Shahida Sultana

    • Mar 6th, 2014

    TRUNCATE removes all rows from a table. The operation cannot be rolled back and no triggers will be fired. As such, TRUCATE is faster and doesnt use as much undo space as a DELETE.

    saravanan

    • Sep 18th, 2012

    Delete & truncate command will delete entries from a table.. where as we can delete a single entry using delete but incase of truncate it wont be possible..

    using truncate will delete the log files,buffer storage in a table permanently but incase of delete it wont

  • What is a transaction

  • What are the types of SQL statement

    majidwgl

    • Dec 5th, 2009

    Data Definition Language.Data Manipulation Languge.Data Transaction Control Language. Data Manipulation Control Language.Data session control. Data system control. etc these are SQL types statements.