0% found this document useful (0 votes)
3 views

PL SQL Pre-Assessment

The document consists of multiple-choice questions (MCQs) related to SQL parsing, optimization, and database management concepts. It covers topics such as the benefits of using the DBMS_STATS package, characteristics of full-table scans, and various SQL hints. Additionally, there are code-related questions that require writing PL/SQL blocks to demonstrate specific functionalities.

Uploaded by

bee
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

PL SQL Pre-Assessment

The document consists of multiple-choice questions (MCQs) related to SQL parsing, optimization, and database management concepts. It covers topics such as the benefits of using the DBMS_STATS package, characteristics of full-table scans, and various SQL hints. Additionally, there are code-related questions that require writing PL/SQL blocks to demonstrate specific functionalities.

Uploaded by

bee
Copyright
© © All Rights Reserved
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Section Question

MCQs 1. Which of the following


statements about SQL parsing is

MCQs 2. What is the main benefit of using


the DBMS_STATS package in

MCQs 3. Which of the following is a


characteristic of a full-table scan?

MCQs 4. When should you consider using


the ALL_ROWS optimizer goal?

MCQs 5. Which type of index is most


appropriate for a column with very

MCQs 6. What is the purpose of the


EXPLAIN PLAN statement?

MCQs 7. Which SQL hint would you use to


force a full-table scan?

MCQs 8. Which of the following is NOT a


phase in SQL statement

MCQs 9. What does the term "bind


variable" refer to in PL/SQL?

MCQs 10. Which optimizer mode is used


by default in Oracle?
MCQs 11. How can you identify whether
an index is being used in a query?

MCQs 12. What is the primary purpose of


using a composite index?

MCQs 13. Which of the following can


negatively impact query

MCQs 14. What does the SQL hint


INDEX_FFS do?

MCQs 15. Which of the following is true


about SQL optimization?

MCQs 16. How does Oracle's


FIRST_ROWS optimizer goal differ

MCQs 17. What is the main advantage of


using Oracle's Parallel Query

MCQs 18. Which SQL clause is most likely


to trigger a sort operation?

MCQs 19. What is the purpose of the


DBMS_XPLAN package?

MCQs 20. Which SQL hint should you use


to force a hash join?
MCQs 21. What does the term "cost" refer
to in the context of the Oracle

MCQs 22. What is the primary purpose of


using the HINT clause in SQL

MCQs 23. Which of the following


statements is true about bind

MCQs 24. What is a potential downside of


using too many indexes on a table?

MCQs 25. Which of the following is NOT a


valid SQL hint?

MCQs 26. What is the impact of using the


NO_INDEX hint in a SQL query?

MCQs 27. Which statement about


optimizer statistics is correct?

MCQs 28. How can you avoid a full-table


scan in a query?

MCQs 29. What does the SQL hint


LEADING do?

MCQs 30. What is the purpose of an


execution plan?

MCQs 31. Which of the following can be


used to force a specific join method
MCQs 32. What does the PARALLEL hint
do in a SQL query?

MCQs 33. Which of the following is a


common cause of suboptimal SQL

MCQs 34. Which of the following is true


about SQL tuning with hints?

MCQs 35. How can you verify that a SQL


query is using an index?

MCQs 36. What is the effect of using the


ORDERED hint in a SQL query?

MCQs 37. Which type of join is typically


more resource-intensive?

MCQs 38. Which Oracle utility can be


used to generate an execution

MCQs 39. What does the NO_MERGE


hint do?

MCQs 40. Which of the following is a


benefit of using bind variables?

Code 41. Write a PL/SQL block that


Code demonstrates how to avoid
42. Given the following SQLfull-
statement, explain how you would
Code 43. Write a PL/SQL block to gather
optimizer statistics using the
Options
A) Parsing occurs only when the SQL statement is executed for the
first time. is the process of checking the SQL syntax and
B) Parsing
semantics.
C) Parsing includes optimizing the SQL statement.
D) Parsing happens after the SQL statement is executed.
A) To improve the readability of SQL statements.
B) To gather and manage optimizer statistics.
C) To convert SQL statements into PL/SQL.
D) To perform backup operations.
A) It always uses an index.
B) It reads the entire table row by row.
C) It is faster than using an index when the table is large.
D) It only occurs when the query involves a GROUP BY clause.
A) When you need to retrieve the first few rows as quickly as
possible.
B) When you want to minimize resource usage.
C) When you want to optimize for the total response time.
D) When using the RULE optimizer mode.
A) B-tree index
B) Bitmap index
C) Reverse key index
D) Function-based index
A) To execute the SQL statement.
B) To display the execution plan of the SQL statement.
C) To debug the SQL statement.
D) To gather statistics for the SQL statement.
A) USE_NL
B) INDEX
C) FULL
D) NO_INDEX
A) Parsing
B) Execution
C) Optimization
D) Compilation
A) A variable that is hard-coded in the SQL statement.
B) A variable that is passed to the SQL statement at runtime.
C) A variable used to bind multiple SQL statements together.
D) A variable that holds the result of a SQL query.
A) RULE
B) CHOOSE
C) COST
D) FIRST_ROWS
A) By checking the query execution time.
B) By using the EXPLAIN PLAN statement.
C) By examining the query syntax.
D) By using the DBMS_STATS package.
A) To reduce the size of the index.
B) To improve the performance of queries that filter on multiple
columns.
C) To store large objects (LOBs).
D) To simplify index management.
A) Using bind variables.
B) Using too many indexes on a table.
C) Using the EXPLAIN PLAN statement.
D) Using the DBMS_STATS package.
A) Forces the use of a full-table scan.
B) Forces the use of a fast full scan of an index.
C) Forces the use of a nested loop join.
D) Forces the use of a hash join.
A) It always involves changing the SQL syntax.
B) It can involve adjusting indexes and optimizer statistics.
C) It is only necessary for complex queries.
D) It is a one-time process.
A) FIRST_ROWS minimizes overall query time, while ALL_ROWS
retrieves
B) rows as quickly
FIRST_ROWS asrows
retrieves possible.
as quickly as possible, while
ALL_ROWS
C) FIRST_ROWS minimizes
uses overall
parallelquery time. while ALL_ROWS does
processing,
not.
D) FIRST_ROWS is for single-row queries, while ALL_ROWS is for
multi-row queries.
A) It simplifies the SQL syntax.
B) It allows multiple users to execute queries simultaneously.
C) It improves query performance by dividing the workload among
multiple processors.
D) It automatically indexes all tables in the query.
A) WHERE
B) GROUP BY
C) JOIN
D) SELECT
A) To gather optimizer statistics.
B) To manage database indexes.
C) To display and format execution plans.
D) To perform database backups.
A) USE_NL
B) USE_MERGE
C) USE_HASH
D) NO_MERGE
A) The monetary cost of executing the query.
B) The estimated time and resources required to execute the query.
C) The number of rows returned by the query.
D) The complexity of the SQL syntax.
A) To modify the structure of the query.
B) To provide directives to the Oracle optimizer on how to execute
the
C) Toquery.
gather statistics on the query performance.
D) To debug the SQL statement.
A) They are used to improve SQL statement reusability and
performance.
B) They are only used in static SQL queries.
C) They decrease the performance of the SQL query.
D) They are automatically indexed by the Oracle database.
A) It improves query performance.
B) It increases the complexity of SQL statements.
C) It can lead to slower data modification operations like INSERT
and
D) It UPDATE.
has no impact on query performance.
A) INDEX
B) PARALLEL
C) USE_HASH
D) NO_CACHE
A) Forces the use of an index for the query.
B) Prevents the optimizer from using any indexes for the query.
C) Forces the use of a full-table scan.
D) Forces the use of a bitmap index.
A) They are irrelevant for the performance of simple queries.
B) They should be updated regularly to ensure optimal query
performance.
C) They are automatically gathered and do not require manual
intervention.
D) They only affect queries using the ALL_ROWS optimizer goal.
A) By using the FULL hint.
B) By creating and using appropriate indexes.
C) By using the NO_INDEX hint.
D) By using the ORDER BY clause.
A) Forces the optimizer to use a specific index.
B) Forces the optimizer to use a specific table as the leading table in
a
C)join.
Forces the optimizer to perform a full-table scan.
D) Forces the optimizer to use a parallel query.
A) To execute the SQL query.
B) To display the steps and order in which the SQL query will be
executed.
C) To modify the SQL query for better performance.
D) To store the results of the SQL query.
A) INDEX
B) USE_NL
C) PARALLEL
D) NO_HASH
A) Forces the use of a parallel query execution.
B) Forces the use of a specific index.
C) Forces the optimizer to use a full-table scan.
D) Forces the use of a hash join.
A) Correctly sized indexes.
B) Properly configured optimizer statistics.
C) Lack of indexes or incorrect use of indexes.
D) Use of bind variables.
A) Hints guarantee that the query will run faster.
B) Hints are only suggestions to the optimizer and may not be used.
C) Hints are automatically added by Oracle to every SQL query.
D) Hints can be used without affecting the execution plan.
A) By examining the SQL syntax.
B) By using the EXPLAIN PLAN statement and checking the
execution plan.at the execution time alone.
C) By looking
D) By counting the number of rows returned by the query.
A) Forces the optimizer to use a full-table scan.
B) Forces the optimizer to join tables in the order specified in the
query.
C) Forces the optimizer to use a parallel query.
D) Forces the optimizer to use an index.
A) Nested loop join
B) Hash join
C) Merge join
D) Cross join
A) DBMS_STATS
B) EXPLAIN PLAN
C) DBMS_XPLAN
D) DBMS_SQLTUNE
A) Prevents the optimizer from merging views or subqueries into the
main query. the optimizer from performing a full-table scan.
B) Prevents
C) Prevents the optimizer from using a hash join.
D) Prevents the optimizer from using a parallel query.
A) Improved query performance and reduced parsing time.
B) Increased execution time.
C) Automatic index creation.
D) Decreased reusability of SQL statements.
N/A
N/A
N/A

You might also like