Oracle PL/SQL and Database Concepts

Test your knowledge of Oracle PL/SQL programming including cursors, triggers, procedures, functions, and database optimization techniques

20 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Which column is more skewed? Total no. of rows in the table are 1000

  1. Deptno column has 5 distinct values, each having 200 rows
  2. Grade column has 2 distinct values having 1 and 999 rows
  3. Location column has 3 distinct values having 300, 400 and 300 rows
  4. All columns have same skewness
Question 2 Multiple Choice (Single Answer)

What is the limit on the size of a PL/SQL block?

  1. 32K
  2. 64K
  3. 100K
  4. None of the Above
Question 3 Multiple Choice (Single Answer)

What is the maximum PL/SQL code size?

  1. 32K
  2. 64K
  3. 100K
  4. No Limit
Question 4 Multiple Choice (Multiple Answers)

Which of the following are the differences between SQL and PL/SQL?

  1. SQL is executed one statement at a time. PL/SQL is executed as a block of code.
  2. 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).
  3. SQL is used to code queries, DML and DDL statements. PL/SQL is used to code program blocks, triggers, functions, procedures and packages.
  4. You can embed SQL in a PL/SQL program, but you cannot embed PL/SQL within a SQL statement.
Question 5 True/False

Can you call a stored function in the constraint of a table ?

  1. True
  2. False
Question 6 Multiple Choice (Single Answer)

Which scenario below indicates HIGH cardinality column?

  1. Scenario 1 : Distinct values for TableA.ColumnA = 10 Total no. of rows for TableA = 100
  2. Scenario 2 : Distinct values for TableA.ColumnB = 20 Total no. of rows for TableA = 100
  3. Scenario 3 : Distinct values for TableA.ColumnC = 30 Total no. of rows for TableA = 100
  4. Distinct values have no corelation to cardinality
Question 7 Multiple Choice (Single Answer)

Can you change the inserted value in one of the columns in AFTER insert trigger code?

  1. Yes
  2. No
  3. Can't Say
  4. None of the above
Question 8 Multiple Choice (Single Answer)

Why does a query in Oracle run faster when ROWID is used as a part of the where clause?

  1. None of the below
  2. Both C & D
  3. ROWID is not a physical column.
  4. ROWID is the logical address of a row.
Question 9 Multiple Choice (Single Answer)

Which of the below are constructs of a procedure, function or a package ?

  1. variables and constants
  2. cursors
  3. exceptions
  4. All of the above
Question 10 Multiple Choice (Single Answer)

What is the maximum no.of statements that can be specified in a trigger statement ?

  1. One
  2. Two
  3. Three
  4. Four
Question 11 Multiple Choice (Single Answer)

What is the maximum no of cascading triggers used at a time?

  1. 24
  2. 8
  3. 16
  4. 32
Question 12 Multiple Choice (Single Answer)

Which symbol preceeds the path to the table in the remote database ?

  1. /
  2. #
  3. @
  4. \
Question 13 Multiple Choice (Single Answer)

If all the values from a cursor have been fetched and another fetch is issued, the output will be :

  1. Error
  2. Last Record
  3. First Record
  4. Can't Say
Question 14 Multiple Choice (Single Answer)

Is Sysdate a system variable or a system function?

  1. System Variable
  2. System Function
  3. Both A & B
  4. None of the Above
Question 15 Multiple Choice (Multiple Answers)

How can you avoid indexes ?

  1. Use FULL hint to optimizer for full table scan
  2. Use INDEX or AND-EQUAL hint to optimizer to use one index or set to indexes instead of another.
  3. Use an expression in the Where Clause of the SQL.
  4. Disable Index on the column
Question 16 True/False

The variables or expressions referenced in the parameter list of a subprogram call are Actual parameters?

  1. True
  2. False
Question 17 True/False

The variables declared in a subprogram specification and referenced in the subprogram body are formal parameters?

  1. True
  2. False
Question 18 Multiple Choice (Single Answer)

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 ?

  1. No
  2. Yes
  3. Can't Say
  4. None of the above
Question 19 Multiple Choice (Single Answer)

Which of the following is not a feature of a cursor FOR loop?

  1. Record type declaration.
  2. Opening and parsing of SQL statements.
  3. Fetches records from cursor.
  4. Requires exit condition to be defined.
Question 20 Multiple Choice (Single Answer)

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?

  1. SQL Server uses a random port
  2. 1433
  3. 1433 and 1434
  4. It depends; the port can be chosen by an administrator