Oracle SQL Test 2

0%

When using explicit cursors, list the correct command sequence to process a batch of records.

Correct! Wrong!

Explanation:
When using explicit cursors, the correct sequence of commands to process a set of records is OPEN, FETCH, CLOSE.

Choose variables that aren't valid.

Correct! Wrong!

Explanation:
The variable type VARCHAR1 is not permitted. There are just two types of variables: VARCHAR and VARCHAR2.

Which of the following functions does not work as a grouping function?

Correct! Wrong!

Explanation:
Qualifiers can be passed as arguments to most functions. DISTINCT and ALL are the qualifiers. Only distinct values returned by the query are taken into account if the DISTINCT qualifier is passed. The "ALL" qualifier instructs the function to take into account all of the query's results. ALL is the default if no other option is supplied.

In the PL/SQL language, where do you declare an explicit cursor?

Correct! Wrong!

Explanation:
The first section of the PL/SQL blocks is the declaration section. This is a section that can be skipped. This is where you'll define all of the variables, cursors, exceptions, subprograms, pragma instructions, and collections that you'll need in the block.

Select the PL/SQL looping construct that isn't valid.

Correct! Wrong!

Explanation:
Although Oracle lacks a Perform Until or Repeat Until loop, you can simulate one. The following is the syntax for simulating a REPEAT UNTIL Loop:
LOOP
{.statements.}
EXIT IF boolean condition is true;
LOOP FINISHED;
When you don't know how many times you want the loop body to execute, you'll use an emulated REPEAT UNTIL Loop.
When a given condition was met, the REPEAT UNTIL Loop will end.

Which of the following is not a DML function in Oracle?

Correct! Wrong!

Explanation:
TRUNCATE is a data definition language (DDL) statement in standard query language (SQL) that deletes all data from a database table without removing the table itself. It makes room on the table or takes up space. On the other hand, TRUNCATE TABLE statements may not be rollbackable in many SQL databases.

Choose the most appropriate response from the options provided below. What comprises a package?

Correct! Wrong!

Explanation:
A package is a schema object that bundles PL/SQL types, variables, and subprograms that are logically connected. A specification (spec) and a body are frequently included in packages; however, the body is not always required. The package's interface is defined by the specification.

Which of the following Oracle PL/SQL exceptions is not valid?

Correct! Wrong!

Explanation:
The TWO_MANY_ROWS exception should not be called TOO_MANY_ROWS .

Choose the incorrect variable declarations.

Correct! Wrong!

Explanation:
The string 'hello world' (11) is longer than the stated variable length of 10.

Premium Tests $49/mo
FREE April-2024