Oracle PL/SQL and Database Concepts
Test your knowledge of Oracle PL/SQL programming including cursors, triggers, procedures, functions, and database optimization techniques
Questions
Which column is more skewed? Total no. of rows in the table are 1000
- Deptno column has 5 distinct values, each having 200 rows
- Grade column has 2 distinct values having 1 and 999 rows
- Location column has 3 distinct values having 300, 400 and 300 rows
- All columns have same skewness
What is the limit on the size of a PL/SQL block?
- 32K
- 64K
- 100K
- None of the Above
What is the maximum PL/SQL code size?
- 32K
- 64K
- 100K
- No Limit
Which of the following are the differences between SQL and PL/SQL?
- SQL is executed one statement at a time. PL/SQL is executed as a block of code.
- SQL tells the database what to do (declarative), not how to do it. In contrast, PL/SQL tell the database how to do things (procedural).
- SQL is used to code queries, DML and DDL statements. PL/SQL is used to code program blocks, triggers, functions, procedures and packages.
- You can embed SQL in a PL/SQL program, but you cannot embed PL/SQL within a SQL statement.
Can you call a stored function in the constraint of a table ?
- True
- False
Which scenario below indicates HIGH cardinality column?
- Scenario 1 : Distinct values for TableA.ColumnA = 10 Total no. of rows for TableA = 100
- Scenario 2 : Distinct values for TableA.ColumnB = 20 Total no. of rows for TableA = 100
- Scenario 3 : Distinct values for TableA.ColumnC = 30 Total no. of rows for TableA = 100
- Distinct values have no corelation to cardinality
Can you change the inserted value in one of the columns in AFTER insert trigger code?
- Yes
- No
- Can't Say
- None of the above
Why does a query in Oracle run faster when ROWID is used as a part of the where clause?
- None of the below
- Both C & D
- ROWID is not a physical column.
- ROWID is the logical address of a row.
Which of the below are constructs of a procedure, function or a package ?
- variables and constants
- cursors
- exceptions
- All of the above
What is the maximum no.of statements that can be specified in a trigger statement ?
- One
- Two
- Three
- Four
What is the maximum no of cascading triggers used at a time?
- 24
- 8
- 16
- 32
Which symbol preceeds the path to the table in the remote database ?
- /
- #
- @
- \
If all the values from a cursor have been fetched and another fetch is issued, the output will be :
- Error
- Last Record
- First Record
- Can't Say
Is Sysdate a system variable or a system function?
- System Variable
- System Function
- Both A & B
- None of the Above
How can you avoid indexes ?
- Use FULL hint to optimizer for full table scan
- Use INDEX or AND-EQUAL hint to optimizer to use one index or set to indexes instead of another.
- Use an expression in the Where Clause of the SQL.
- Disable Index on the column
The variables or expressions referenced in the parameter list of a subprogram call are Actual parameters?
- True
- False
The variables declared in a subprogram specification and referenced in the subprogram body are formal parameters?
- True
- False
If I have an execute privilege on a procedure in another users schema, can I execute his procedure even though I do not have privileges on the tables within the procedure ?
- No
- Yes
- Can't Say
- None of the above
Which of the following is not a feature of a cursor FOR loop?
- Record type declaration.
- Opening and parsing of SQL statements.
- Fetches records from cursor.
- Requires exit condition to be defined.
You want to access a SQL Server instance that is not in your domain. The only network protocol you can use is TCP/IP. Which ports do you need to open on the firewall that is between your computer and the server running SQL Server?
- SQL Server uses a random port
- 1433
- 1433 and 1434
- It depends; the port can be chosen by an administrator