Deck 2: Basic PL/SQL Block Structures

ملء الشاشة (f)
exit full mode
سؤال
With respect to processing efficiency, the less code that has to be processed, the faster the program runs.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
The LOOP statement is a mechanism that allows the checking of a condition to determine if statements should or should not be processed.
سؤال
The following code fragment is a correct example of the use of a basic loop.
BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
سؤال
Even though the EXIT clause can be used in any type of loop, it is considered good form to use the EXIT clause only in basic loops.
سؤال
When an IF statement checks only one condition and performs actions only if the condition is True, it is referred to as a simple IF condition.
سؤال
The keyword DEFAULT can be used in place of the := symbol to assign initial values to the variables within the declaration statement.
سؤال
The only required sections of a PL/SQL block are DECLARE and END.
سؤال
The CASE statement begins with the keyword CASE followed by a selector that is typically a variable name.
سؤال
The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types. _________________________
سؤال
The syntax of the following code fragment is correct:
IF rec_order.state = 'VA' THEN
lv_tax_num := rec_order.sub * .06;
ELSEIF rec_order.state = 'ME' THEN
lv_tax_num := rec_order.sub * .05;
ELSE
lv_tax_num := rec_order.sub * .04;
END IF
سؤال
The following code fragment is a correct example of the use of a WHILE loop.
BEGIN
WHILE lv_cnt_num <= 5
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
سؤال
The term anonymous blocks refers to blocks of code that are not stored for reuse and do not exist after being executed.
سؤال
An infinite loop causes a program to loop indefinitely, disrupting the ability of the code to continue with any processing beyond the loop.
سؤال
The EXIT WHEN clause ensures that a basic loop runs at least once.
سؤال
The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types.
سؤال
Assignment statements are used to put or change the values of variables.
سؤال
The following code fragment is a correct example of the use of a FOR loop.
BEGIN
FOR i IN 1..5
DBMS_OUTPUT.PUT_LINE( i );
END LOOP;
END;
سؤال
The following loop terminates when the lv_cnt_num variable holds a value of 6.
BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
سؤال
The following loop iterates four times.
BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
سؤال
The syntax of the following code fragment is correct.
IF rec_order.state = 'VA' THEN
lv_tax_num := rec_order.sub * .06;
ELS IF rec_order.state = 'ME' THEN
lv_tax_num := rec_order.sub * .05;
END IF
سؤال
If the WHERE clause is not included the basic loop, the result is the programmer's nightmare of the infinite loop. _________________________
سؤال
Variables are named memory areas that hold values to allow retrieval and manipulation of values within your programs. _________________________
سؤال
The only required sections of a PL/SQL block are the ____ sections.

A) BEGIN & DECLARE
B) DECLARE & EXCEPTION
C) BEGIN & END
D) EXCEPTION & END
سؤال
The EXCEPTION section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs. _________________________
سؤال
Which of the following lines of code is syntactically correct?

A) DECLARE
Order NUMBER;
Departure DATE;
BEGIN
---- executable statements ---
END
B) DECLARE
Order NUMBER;
Departure DATE
BEGIN
---- executable statements ---
END
C) DECLARE
Order NUMBER(2);
Departure DATE;
BEGIN;
---- executable statements ---
END
D) DECLARE
Order NUMBER(3);
Departure DATE;
BEGIN
---- executable statements ---
END;
سؤال
When an IF statement checks only one condition and performs actions only if the condition is True, it is referred to as a(n) simple IF condition. _________________________
سؤال
A(n) CASE expression evaluates conditions and returns a value in an assignment statement. _________________________
سؤال
The ____ section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs when the executable statements are processed.

A) EXCEPTION
B) BEGIN
C) DECLARE
D) END
سؤال
____ are named memory areas that hold values to allow the retrieval and manipulation of values in a program.

A) Loops
B) Assignment statements
C) Blocks
D) Variables
سؤال
The Searched CASE statement does not use a selector but individually evaluates conditions that are placed in the WHERE clauses. _________________________
سؤال
The DECLARE section of the PL/SQL block contains all the processing action, or programming logic. _________________________
سؤال
The basic loop dictates exactly how many times the loop should run in the opening LOOP clause. ____________________
سؤال
A(n) scalar variable can hold only a single value. _________________________
سؤال
The ____ section of a PL/SQL block contains code that creates variables, cursors, and types.

A) DECLARE
B) BEGIN
C) EXCEPTION
D) END
سؤال
Which of the following initializes the variable order?

A) DECLARE
Order NUMBER(2);
Departure DATE;
BEGIN
---- executable statements ---
END;
B) DECLARE
Order NUMBER(2) = 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
C) DECLARE
Order NUMBER(2) =: 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
D) DECLARE
Order NUMBER(2) := 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
سؤال
The basic loop uses the LOOP and END LOOP markers to begin and end the loop code. _________________________
سؤال
Loops are used for situations in which we need to repeat a line or lines of code within our block. _________________________
سؤال
The common data types used for cursor variables include character, numeric, date, and Boolean. _________________________
سؤال
To keep code efficient and minimize statement processing, any statements that are dynamic in nature should be placed outside a loop. _________________________
سؤال
____ are used to change the values of variables.

A) Loops
B) Assignment statements
C) Exceptions
D) Blocks
سؤال
Which of the following PL/SQL blocks requires the variable to always contain a particular value within the block?

A) DECLARE
Order NUMBER(2) := 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
B) DECLARE
Order NUMBER(2,2) := .06;
Departure DATE;
BEGIN
---- executable statements ---
END;
C) DECLARE
Order CONSTANT NUMBER(2,2) := .02;
Departure DATE;
BEGIN
---- executable statements ---
END;
D) DECLARE
Order NUMBER(2) CONSTANT := .03;
Departure DATE;
BEGIN
---- executable statements ---
END;
سؤال
BEGIN WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
According to the code fragment above, how many times does the loop iterate?

A) 3
B) 4
C) 5
D) 6
سؤال
Which of the following statements is correct?

A) IF order > 5
Prize = 'yes';
END IF;
B) IF order > 5 THEN
Prize = 'yes';
ENDIF
C) IF order > 5 THEN;
Prize = 'yes';
END IF;
D) IF order > 5 THEN
Prize := 'yes';
END IF;
سؤال
FOR i IN 1..tbl_roast.COUNT LOOP lv_tot_num := lv_tot_num + tbl_roast(i);
END LOOP;
In the above code fragment, which of the following holds the value of the current iteration number?

A) tbl_roast
B) i
C) COUNT
D) lv_tot_num
سؤال
The ____ uses the LOOP and END LOOP markers to begin and end the loop code.

A) basic loop
B) cursor
C) index-by table
D) general loop
سؤال
Which of the following statement blocks correctly uses a scalar variable in an assignment statement?

A) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt = 12;
END;
B) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt := 12 * order;
END;
C) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Order := total_amt *12;
END;
D) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt := total_amt *12;
END;
سؤال
Which of the following dictates exactly how many times the loop should run in the opening LOOP clause?

A) CASE
B) WHILE loop
C) FOR loop
D) Basic loop
سؤال
DECLARE order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt := order * 8;
END;
According to the statement block above, what value is stored in the variable total_amt?

A) 4
B) 8
C) 12
D) 32
سؤال
Which of the following does not use a selector, but individually evaluates conditions that are placed in WHEN clauses?

A) Control statements
B) Searched CASE
C) Loops
D) CASE expression
سؤال
The statements that are used to control the flow of logic processing in your programs are commonly referred to as ____.

A) exceptions
B) control structures
C) pragma statements
D) index-by tables
سؤال
Which of the following statements is True?

A) The WHEN clause of a CASE statement ends with a semicolon.
B) The WHEN clause of a CASE statement ends with "END CASE;".
C) The WHEN clause of a CASE expression does not end with a semicolon.
D) The WHEN clause of a CASE statement ends with "ENDCASE".
سؤال
Which of the following evaluates conditions and returns a value in an assignment statement?

A) Searched CASE
B) Basic loop
C) CASE expression
D) Control statement
سؤال
BEGIN LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
EXIT WHEN lv_cnt_num >= 5;
END LOOP;
END;
Which of the statements in the code fragment above ensures that the loop executes at least once?

A) LOOP
B) lv_cnt_num := lv_cnt_num + 1;
C) EXIT WHEN lv_cnt_num >= 5;
D) DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
سؤال
Which of the following code fragments would not raise an error?

A) BEGIN
WHILE lv_cnt_num <= 5
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
B) BEGIN
WHILE lv_cnt_num <= 5
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END;
C) BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
D) BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
سؤال
Which of the following code fragments would not raise an error?

A) IF rec.state = 'VA' OR 'PA' THEN
A := b * .06;
ELSE
A := b * .04;
END IF;
B) IF rec.state = 'VA' OR rec.state = 'PA' THEN
A := b * .06;
ELSE
A := b * .04;
END IF;
C) IF rec.state = 'VA' OR rec.state = 'PA'
A := b * .06;
ELSE
A := b * .04;
END IF;
D) IF rec.state = 'VA' OR rec.state = 'PA' THEN
A := b * .06;
ELSE
A := b * .04;
END IF
سؤال
Which of the following code fragments would not raise an error?

A) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
B) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
EXIT WHEN lv_cnt_num >= 5;
Lv_cnt_num := lv_cnt_num + 1;
END;
C) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
EXIT WHEN lv_cnt_num >= 5;
Lv_cnt_num := lv_cnt_num + 1
END LOOP
END
D) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
EXIT WHEN lv_cnt_num >= 5;
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
سؤال
Which of the following allow us to repeat the processing of a desired portion of code?

A) Functions
B) Looping constructs
C) IF statements
D) CASE expressions
سؤال
Which of the following code fragments would not raise an error?

A) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSEIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
B) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSE IF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
C) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
D) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELS IF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
سؤال
If the EXIT WHEN clause is not included in a basic loop, then the result is a(n) ____.

A) infinite loop
B) exception
C) RAISE_APPLICATION_ERROR
D) SQLCODE error
سؤال
Which of the following clauses ensures that a basic loop runs at least once?

A) EXIT WHEN
B) WHERE
C) CASE
D) LOOP
سؤال
The ____________________ section of the PL/SQL block contains code that creates variables, cursors, and types.
سؤال
Which of the following code fragments would not raise an error?

A) BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
B) BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(c)
END LOOP
END;
C) BEGIN
FOR i IN 1..10
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
D) BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE
END LOOP
END;
سؤال
The code order NUMBER(2) := 6; is an example of a(n) ____________________.
سؤال
____________________ are used for situations in which we need to repeat a line or lines of code within our block.
سؤال
_____________________ statements are used to put or change values in variables.
سؤال
IF rec_order.state = 'VA' THEN lv_tax_num := rec_order.sub * .06;
ELSIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
Which of the clauses in the code fragment above would not cause the IF statement to raise an error if it were excluded?

A) ELSE
B) IF
C) END IF
D) THEN
سؤال
The ____________________ section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs during the executable statements in the BEGIN section.
سؤال
A(n) ____________________ variable can hold only a single value.
سؤال
By indicating a numeric range, the ____________________ dictates exactly how many times the loop should run in the opening LOOP clause.
سؤال
What is the purpose of the BEGIN section of a PL/SQL block?
سؤال
The simple IF statement performs an action only if the condition is ____________________.
سؤال
The ____________________ loop is constructed with conditions in the LOOP statement to determine when the looping action begins and ends.
سؤال
A(n) ____________________ statement does not use a selector but individually evaluates conditions that are placed in the WHEN clauses.
سؤال
If the EXIT WHEN clause is not included in the basic loop, the result is the programmer's nightmare of a(n) ____________________.
سؤال
To declare a variable, you must supply a variable name and ____________________.
سؤال
Which of the following code fragments is correct?

A) FOR i IN 1..tbl.COUNT
Lv_tot_num := lv_tot_num + tbl_roast(i);
END LOOP;
B) FOR i IN 1..tbl.COUNT LOOP
Lv_tot_num := lv_tot_num + tbl_roast(i)
END LOOP
C) FOR i IN 1..tbl.COUNT LOOP
Lv_tot_num = lv_tot_num + tbl_roast(i);
END LOOP;
D) FOR i IN 1..tbl.COUNT LOOP
Lv_tot_num := lv_tot_num + tbl_roast(i);
END LOOP;
سؤال
Which of the following can be referenced in the loop but cannot be assigned a value because it is controlled by the loop?

A) The counter variable
B) The IN clause
C) The INSERT INTO clause
D) The FOR clause
سؤال
The ____________________ statement is a mechanism that allows the checking of a condition to determine whether or not statements should be processed.
سؤال
Why would the following code raise an error? IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSEIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;

A) Semicolon after THEN is omitted
B) No space between ELSE and IF
C) ELSEIF is not a keyword
D) ":=" should be "="
سؤال
The ____________________ option can be added to the variable declaration to require the variable to always contain a particular value within the block.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/81
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 2: Basic PL/SQL Block Structures
1
With respect to processing efficiency, the less code that has to be processed, the faster the program runs.
True
2
The LOOP statement is a mechanism that allows the checking of a condition to determine if statements should or should not be processed.
False
3
The following code fragment is a correct example of the use of a basic loop.
BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
False
4
Even though the EXIT clause can be used in any type of loop, it is considered good form to use the EXIT clause only in basic loops.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
5
When an IF statement checks only one condition and performs actions only if the condition is True, it is referred to as a simple IF condition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
6
The keyword DEFAULT can be used in place of the := symbol to assign initial values to the variables within the declaration statement.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
7
The only required sections of a PL/SQL block are DECLARE and END.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
8
The CASE statement begins with the keyword CASE followed by a selector that is typically a variable name.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
9
The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
10
The syntax of the following code fragment is correct:
IF rec_order.state = 'VA' THEN
lv_tax_num := rec_order.sub * .06;
ELSEIF rec_order.state = 'ME' THEN
lv_tax_num := rec_order.sub * .05;
ELSE
lv_tax_num := rec_order.sub * .04;
END IF
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
11
The following code fragment is a correct example of the use of a WHILE loop.
BEGIN
WHILE lv_cnt_num <= 5
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
12
The term anonymous blocks refers to blocks of code that are not stored for reuse and do not exist after being executed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
13
An infinite loop causes a program to loop indefinitely, disrupting the ability of the code to continue with any processing beyond the loop.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
14
The EXIT WHEN clause ensures that a basic loop runs at least once.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
15
The BEGIN section of a PL/SQL block contains code that creates variables, cursors, and types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
16
Assignment statements are used to put or change the values of variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
17
The following code fragment is a correct example of the use of a FOR loop.
BEGIN
FOR i IN 1..5
DBMS_OUTPUT.PUT_LINE( i );
END LOOP;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
18
The following loop terminates when the lv_cnt_num variable holds a value of 6.
BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
19
The following loop iterates four times.
BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
20
The syntax of the following code fragment is correct.
IF rec_order.state = 'VA' THEN
lv_tax_num := rec_order.sub * .06;
ELS IF rec_order.state = 'ME' THEN
lv_tax_num := rec_order.sub * .05;
END IF
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
21
If the WHERE clause is not included the basic loop, the result is the programmer's nightmare of the infinite loop. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
22
Variables are named memory areas that hold values to allow retrieval and manipulation of values within your programs. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
23
The only required sections of a PL/SQL block are the ____ sections.

A) BEGIN & DECLARE
B) DECLARE & EXCEPTION
C) BEGIN & END
D) EXCEPTION & END
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
24
The EXCEPTION section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
25
Which of the following lines of code is syntactically correct?

A) DECLARE
Order NUMBER;
Departure DATE;
BEGIN
---- executable statements ---
END
B) DECLARE
Order NUMBER;
Departure DATE
BEGIN
---- executable statements ---
END
C) DECLARE
Order NUMBER(2);
Departure DATE;
BEGIN;
---- executable statements ---
END
D) DECLARE
Order NUMBER(3);
Departure DATE;
BEGIN
---- executable statements ---
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
26
When an IF statement checks only one condition and performs actions only if the condition is True, it is referred to as a(n) simple IF condition. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
27
A(n) CASE expression evaluates conditions and returns a value in an assignment statement. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
28
The ____ section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs when the executable statements are processed.

A) EXCEPTION
B) BEGIN
C) DECLARE
D) END
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
29
____ are named memory areas that hold values to allow the retrieval and manipulation of values in a program.

A) Loops
B) Assignment statements
C) Blocks
D) Variables
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
30
The Searched CASE statement does not use a selector but individually evaluates conditions that are placed in the WHERE clauses. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
31
The DECLARE section of the PL/SQL block contains all the processing action, or programming logic. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
32
The basic loop dictates exactly how many times the loop should run in the opening LOOP clause. ____________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
33
A(n) scalar variable can hold only a single value. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
34
The ____ section of a PL/SQL block contains code that creates variables, cursors, and types.

A) DECLARE
B) BEGIN
C) EXCEPTION
D) END
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following initializes the variable order?

A) DECLARE
Order NUMBER(2);
Departure DATE;
BEGIN
---- executable statements ---
END;
B) DECLARE
Order NUMBER(2) = 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
C) DECLARE
Order NUMBER(2) =: 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
D) DECLARE
Order NUMBER(2) := 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
36
The basic loop uses the LOOP and END LOOP markers to begin and end the loop code. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
37
Loops are used for situations in which we need to repeat a line or lines of code within our block. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
38
The common data types used for cursor variables include character, numeric, date, and Boolean. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
39
To keep code efficient and minimize statement processing, any statements that are dynamic in nature should be placed outside a loop. _________________________
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
40
____ are used to change the values of variables.

A) Loops
B) Assignment statements
C) Exceptions
D) Blocks
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
41
Which of the following PL/SQL blocks requires the variable to always contain a particular value within the block?

A) DECLARE
Order NUMBER(2) := 0;
Departure DATE;
BEGIN
---- executable statements ---
END;
B) DECLARE
Order NUMBER(2,2) := .06;
Departure DATE;
BEGIN
---- executable statements ---
END;
C) DECLARE
Order CONSTANT NUMBER(2,2) := .02;
Departure DATE;
BEGIN
---- executable statements ---
END;
D) DECLARE
Order NUMBER(2) CONSTANT := .03;
Departure DATE;
BEGIN
---- executable statements ---
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
42
BEGIN WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
According to the code fragment above, how many times does the loop iterate?

A) 3
B) 4
C) 5
D) 6
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
43
Which of the following statements is correct?

A) IF order > 5
Prize = 'yes';
END IF;
B) IF order > 5 THEN
Prize = 'yes';
ENDIF
C) IF order > 5 THEN;
Prize = 'yes';
END IF;
D) IF order > 5 THEN
Prize := 'yes';
END IF;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
44
FOR i IN 1..tbl_roast.COUNT LOOP lv_tot_num := lv_tot_num + tbl_roast(i);
END LOOP;
In the above code fragment, which of the following holds the value of the current iteration number?

A) tbl_roast
B) i
C) COUNT
D) lv_tot_num
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
45
The ____ uses the LOOP and END LOOP markers to begin and end the loop code.

A) basic loop
B) cursor
C) index-by table
D) general loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
46
Which of the following statement blocks correctly uses a scalar variable in an assignment statement?

A) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt = 12;
END;
B) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt := 12 * order;
END;
C) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Order := total_amt *12;
END;
D) DECLARE
Order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt := total_amt *12;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
47
Which of the following dictates exactly how many times the loop should run in the opening LOOP clause?

A) CASE
B) WHILE loop
C) FOR loop
D) Basic loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
48
DECLARE order NUMBER(2) := 4;
Total_amt NUMBER(2);
BEGIN
Total_amt := order * 8;
END;
According to the statement block above, what value is stored in the variable total_amt?

A) 4
B) 8
C) 12
D) 32
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
49
Which of the following does not use a selector, but individually evaluates conditions that are placed in WHEN clauses?

A) Control statements
B) Searched CASE
C) Loops
D) CASE expression
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
50
The statements that are used to control the flow of logic processing in your programs are commonly referred to as ____.

A) exceptions
B) control structures
C) pragma statements
D) index-by tables
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
51
Which of the following statements is True?

A) The WHEN clause of a CASE statement ends with a semicolon.
B) The WHEN clause of a CASE statement ends with "END CASE;".
C) The WHEN clause of a CASE expression does not end with a semicolon.
D) The WHEN clause of a CASE statement ends with "ENDCASE".
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
52
Which of the following evaluates conditions and returns a value in an assignment statement?

A) Searched CASE
B) Basic loop
C) CASE expression
D) Control statement
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
53
BEGIN LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
EXIT WHEN lv_cnt_num >= 5;
END LOOP;
END;
Which of the statements in the code fragment above ensures that the loop executes at least once?

A) LOOP
B) lv_cnt_num := lv_cnt_num + 1;
C) EXIT WHEN lv_cnt_num >= 5;
D) DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
54
Which of the following code fragments would not raise an error?

A) BEGIN
WHILE lv_cnt_num <= 5
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
B) BEGIN
WHILE lv_cnt_num <= 5
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END;
C) BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
D) BEGIN
WHILE lv_cnt_num <= 5 LOOP
DBMS_OUTPUT.PUT_LINE(lv_cnt_num);
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
55
Which of the following code fragments would not raise an error?

A) IF rec.state = 'VA' OR 'PA' THEN
A := b * .06;
ELSE
A := b * .04;
END IF;
B) IF rec.state = 'VA' OR rec.state = 'PA' THEN
A := b * .06;
ELSE
A := b * .04;
END IF;
C) IF rec.state = 'VA' OR rec.state = 'PA'
A := b * .06;
ELSE
A := b * .04;
END IF;
D) IF rec.state = 'VA' OR rec.state = 'PA' THEN
A := b * .06;
ELSE
A := b * .04;
END IF
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
56
Which of the following code fragments would not raise an error?

A) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
B) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
EXIT WHEN lv_cnt_num >= 5;
Lv_cnt_num := lv_cnt_num + 1;
END;
C) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
EXIT WHEN lv_cnt_num >= 5;
Lv_cnt_num := lv_cnt_num + 1
END LOOP
END
D) BEGIN
LOOP
DBMS_OUTPUT.PUT_LINE( lv_cnt_num );
EXIT WHEN lv_cnt_num >= 5;
Lv_cnt_num := lv_cnt_num + 1;
END LOOP;
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
57
Which of the following allow us to repeat the processing of a desired portion of code?

A) Functions
B) Looping constructs
C) IF statements
D) CASE expressions
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
58
Which of the following code fragments would not raise an error?

A) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSEIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
B) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSE IF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
C) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
D) IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELS IF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
59
If the EXIT WHEN clause is not included in a basic loop, then the result is a(n) ____.

A) infinite loop
B) exception
C) RAISE_APPLICATION_ERROR
D) SQLCODE error
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
60
Which of the following clauses ensures that a basic loop runs at least once?

A) EXIT WHEN
B) WHERE
C) CASE
D) LOOP
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
61
The ____________________ section of the PL/SQL block contains code that creates variables, cursors, and types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
62
Which of the following code fragments would not raise an error?

A) BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
B) BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE(c)
END LOOP
END;
C) BEGIN
FOR i IN 1..10
DBMS_OUTPUT.PUT_LINE(i);
END LOOP;
END;
D) BEGIN
FOR i IN 1..10 LOOP
DBMS_OUTPUT.PUT_LINE
END LOOP
END;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
63
The code order NUMBER(2) := 6; is an example of a(n) ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
64
____________________ are used for situations in which we need to repeat a line or lines of code within our block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
65
_____________________ statements are used to put or change values in variables.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
66
IF rec_order.state = 'VA' THEN lv_tax_num := rec_order.sub * .06;
ELSIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;
Which of the clauses in the code fragment above would not cause the IF statement to raise an error if it were excluded?

A) ELSE
B) IF
C) END IF
D) THEN
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
67
The ____________________ section of a PL/SQL block contains handlers that allow you to control what the application will do if an error occurs during the executable statements in the BEGIN section.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
68
A(n) ____________________ variable can hold only a single value.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
69
By indicating a numeric range, the ____________________ dictates exactly how many times the loop should run in the opening LOOP clause.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
70
What is the purpose of the BEGIN section of a PL/SQL block?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
71
The simple IF statement performs an action only if the condition is ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
72
The ____________________ loop is constructed with conditions in the LOOP statement to determine when the looping action begins and ends.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
73
A(n) ____________________ statement does not use a selector but individually evaluates conditions that are placed in the WHEN clauses.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
74
If the EXIT WHEN clause is not included in the basic loop, the result is the programmer's nightmare of a(n) ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
75
To declare a variable, you must supply a variable name and ____________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
76
Which of the following code fragments is correct?

A) FOR i IN 1..tbl.COUNT
Lv_tot_num := lv_tot_num + tbl_roast(i);
END LOOP;
B) FOR i IN 1..tbl.COUNT LOOP
Lv_tot_num := lv_tot_num + tbl_roast(i)
END LOOP
C) FOR i IN 1..tbl.COUNT LOOP
Lv_tot_num = lv_tot_num + tbl_roast(i);
END LOOP;
D) FOR i IN 1..tbl.COUNT LOOP
Lv_tot_num := lv_tot_num + tbl_roast(i);
END LOOP;
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
77
Which of the following can be referenced in the loop but cannot be assigned a value because it is controlled by the loop?

A) The counter variable
B) The IN clause
C) The INSERT INTO clause
D) The FOR clause
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
78
The ____________________ statement is a mechanism that allows the checking of a condition to determine whether or not statements should be processed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
79
Why would the following code raise an error? IF rec_order.state = 'VA' THEN
Lv_tax_num := rec_order.sub * .06;
ELSEIF rec_order.state = 'ME' THEN
Lv_tax_num := rec_order.sub * .05;
ELSE
Lv_tax_num := rec_order.sub * .04;
END IF;

A) Semicolon after THEN is omitted
B) No space between ELSE and IF
C) ELSEIF is not a keyword
D) ":=" should be "="
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
80
The ____________________ option can be added to the variable declaration to require the variable to always contain a particular value within the block.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 81 في هذه المجموعة.