Database Performance & PL/SQL Fundamentals
Test your knowledge of SQL optimization, PL/SQL programming, database performance tuning, indexing, and Oracle database features.
Questions
How many columns are presented after executing this query: SELECT address1||','||address2||','||address2 "Adress" FROM employee;
- 3
- 4
- 1
- None
Which of the following can be a valid column name?
- Column
- 1966_Invoices
- #Invoices
- Catch_#22
When a user creates an object without a TABLESPACE clause, where will Oracle store the segment?
- Default tablespace for the user
- Oracle will give an error
- System tablespace
- Users tablespace
In this PL/SQL statement, which of the following lines will produce an error?
- cursor CAPITALS is
- select CITY, STATE
- into my_city, my_state
- from CITIES where CAPITAL = 'Y';
PL/SQL raises an exception, in which TWO of the following cases:
- When the datatypes of SELECT clause and INTO clause do not match
- When a SELECT statement returns more than one row
- When a SELECT statement returns no rows
- When INTO statement is missing in the SELECT statement
What is the result if two NULL values are compared to each other?
- True
- False
- NULL
- Undefined
Which section of a PL/SQL block would most likely contain a RAISE statement?
- Header
- Declarative
- Executable
- Exception
Assuming today is Monday, 10 July 2000, what is returned by this statement: SELECT to_char(NEXT_DAY(sysdate, 'MONDAY'), 'DD-MON-RR') FROM dual;
- 10-JUL-00
- 17-JUL-00
- 12-JUL-00
- 11-JUL-00
SQL statement with “High Selectivity” means
- No. of rows returned by SQL statement are HIGH
- No. of rows returned by SQL statement are FEW
- No. of rows returned by SQL statement are > 10000
- No. of rows returned by SQL statement are > 50000
Why one should not use “select * from table;” Choose all that apply
- Avoid full table scan
- Avoid index scan
- Avoid network traffic
- Avoid cartesian join
What is skewed data column?
- Columns that contains values with less variation in the number of duplicates
- Columns that contains values with large variation in the number of duplicates
- Columns that contains values with no variation in the number of duplicates
- Columns that contains values with ZERO variation in the number of duplicates
Which tool is used to analyze access path of SQL statement?
- Exp
- Imp
- Explain Plan
- vi Editor
What is true about the explain plan? Choose all that apply
- The more heavily indented an access path is, the earlier it is executed
- The more heavily indented an access path is, the later it is executed
- If two steps are indented at the same level, the uppermost statement is executed first
- If two steps are indented at the same level, the uppermost statement is executed last
What is true about ordering in the SQL statement? Choose all that apply
- Right to Left processing of Source (Tables, views etc.) by Parser
- Left to Right processing of Source (Tables, views etc.) by Parser
- Bottom to Up processing of WHERE condition clauses
- Up to Bottom processing of WHERE condition clauses
Why one should not use NULL / NOT NULL operator on indexed columns?
- Using NULL / NOT NULL on indexed columns won’t use INDEX
- Using NULL / NOT NULL on indexed columns gives ERROR
- Using NULL / NOT NULL on indexed columns disables INDEX
- Using NULL / NOT NULL on indexed columns makes the INDEX unusable
Using frequent COMMIT statements in the code frees up resources like undo segments, locks acquired etc.
- True
- False
What is the expansion of ADDM?
- Automated Database Deployment Monitor
- Automated Database Development Monitor
- Automated Database Diagnostic Monitor
- Automated Database Distributed Monitor
Which view helps in identifying resource utilization of queries?
- V$SQL
- V$SQL_STAT
- V$SQLSTATS
- V$SQL_STATISTICS
Which of the following degrades the performance of database?
- Equi Join
- Outer Join
- Non-Equi Join
- Cartesian Join
Do you need to recycle Views for better performance?
- True
- False