List Of Top Oracle Data Access Interview Questions
Q – 1 Explain What are the values that can be specified for OPTIMIZER MODE Parameter?
Ans- COST and RULE.
Q – 2 Explain What are the factors that affect OPTIMIZER in choosing an Optimization approach?
Ans- The OPTIMIZER_MODE initialization parameter Statistics in the Data Dictionary the OPTIMIZER_GOAL parameter of the ALTER SESSION command hints in the statement.
Q – 3 Explain What are the values that can be specified for OPTIMIZER_GOAL parameter of the ALTER SESSION Command?
Ans- CHOOSE,
ALL_ROWS,
FIRST_ROWS and
RULE.
Q – 4 What is COST-based approach to optimization?
Ans- Considering available access paths and determining the most efficient execution plan based on statistics in the data dictionary for the tables accessed by the statement and their associated clusters and indexes.
Q – 5 Explain What does ROLLBACK do?
Ans- ROLLBACK retracts any of the changes resulting from the SQL statements in the transaction.
Q – 6 Explain When does a Transaction end?
Ans- Commit, Rollback, DCL command like grant revoke.When exit from oracle (implicite commit happened), When database abnormally closed then an implicit rollback happened. When user invokes an DDl command
Q – 7 Explain There is a field of type character in the table, but we are storing numeric values like (Roll number) in this field, so if we want to sort the field (in java) according to numbers. How?
Ans- select to_number(rollnumber) from tname order by rollnumber
Q – 8 Explain What are the different approaches used by Optimizer in choosing an execution plan ?
Ans- Rule-based and Cost-based.
Q – 9 Explain What is the function of Optimizer?
Ans- The goal of the optimizer is to choose the most efficient way to execute a SQL statement.
Q – 10 Explain What does COMMIT do?
Ans- COMMIT makes permanent the changes resulting from all SQL statements in the transaction. The changes made by the SQL statements of a transaction become visible to other user sessions transactions that start only after transaction is committed.
Q – 11 Explain Transaction?
Ans- A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user.
Q – 12 What is RULE-based approach to optimization?
Ans- Choosing an executing planbased on the access paths available and the ranks of these access paths.
Q – 13 Explain What is the effect of setting the value “CHOOSE” for OPTIMIZER_GOAL, parameter of the ALTER SESSION Command?
Ans- The Optimizer chooses Cost_based approach and optimizes with the goal of best throughput if statistics for atleast one of the tables accessed by the SQL statement exist in the data dictionary. Otherwise the OPTIMIZER chooses RULE_based approach.
Q – 14 Explain What is SAVE POINT?
Ans- For long transactions that contain many SQL statements, intermediate markers or savepoints can be declared which can be used to divide a transaction into smaller parts. This allows the option of later rolling back all work performed from the current point in the transaction to a declared savepoint within the transaction.
Q – 15 Explain What is Execution Plan?
Ans- The combination of the steps the optimizer chooses to execute a statement is called an execution plan.
Q – 16 Explain What is Read-Only Transaction?
Ans- A Read-Only transaction ensures that the results of each query executed in the transaction are consistant with respect to the same point in time.
Q – 17 Explain What is the effect of setting the value “ALL_ROWS” for OPTIMIZER_GOAL parameter of the ALTER SESSION command?
Ans- This value causes the optimizer to the cost-based approach for all SQL statements in the session regardless of the presence of statistics and to optimize with a goal of best throughput.
Q – 18 Explain Can we delete tuples in a table based on date column? And how?
Ans- Use this SQL query :delete from student_tab A where ROWID > ( select min(ROWID) from student_tab B where A.roll_number = B.roll_number);Note : Table Name = student_tab Key to table = roll_number
Yes ,, we can delete entries from a table based on the date column,,Only we have to mention the date format or other wise we’ll have to make use of the sys date.