Sei sulla pagina 1di 28

Section 1 Quiz

(Answer all questions in this section)

11. In which three ways does PL/SQL extend the SQL programming
language? Mark for Review
(1) Points

(Choose all correct answers)

By adding conditional control. (*)

By adding procedural constructs. (*)

By adding iterative control. (*)

By adding compound constructs.

Incorrect Incorrect. Refer to Section 1 Lesson 1.

12. Which of the following statements about PL/SQL and SQL is true?
Mark for Review
(1) Points

PL/SQL allows basic program logic and control flow to be combined with SQL
statements. (*)

PL/SQL and SQL are both Oracle proprietary programming languages.

PL/SQL and SQL can be used with many types of databases, including Oracle.

PL/SQL and SQL are both ANSI-compliant.

Correct Correct

13. PL/SQL is an Oracle proprietary, procedural, fourth-generation


programming language. True or False? Mark for Review
(1) Points

True

False (*)
Correct Correct

14. Fourth-generation programming languages include all except _____


and _____. Mark for Review
(1) Points

(Choose all correct answers)

PL/SQL (*)

C++ (*)

SQL

MySQL

Java (*)

Correct Correct

15. SQL is a common access language for many types of databases,


including Oracle. True or False? Mark for Review
(1) Points

True (*)

False

Correct Correct

Previous Page 3 of 3

Section 1 Quiz
(Answer all questions in this section)

6. The fact that PL/SQL is portable is a good thing because: Mark


for Review
(1) Points
Blocks can be sent to the operating system.

PL/SQL code can be developed on one platform and deployed on another (*)

PL/SQL code can be run on any operating system without a database

Exceptions can be ported to different operating systems

Correct Correct

7. Comparing PL/SQL with other languages such as C and Java, which


of the following statements is true? Mark for Review
(1) Points

PL/SQL is easier to learn and does not require an Oracle database or tool

PL/SQL is easier to learn but less efficient

PL/SQL is harder to learn

PL/SQL is easier to learn and more efficient (*)

Correct Correct

8. PL/SQL differs from C and Java in which of the following ways?


(Choose two.) Mark for Review
(1) Points

(Choose all correct answers)

It requires an Oracle database or tool. (*)

It is the most efficient language to use with an Oracle database. (*)

It is the most complex programming language to learn.

It is not portable to other operating systems.

It does not support object-oriented programming.


Correct Correct

9. Procedural constructs give you better control of your SQL


statements and their execution. True or False? Mark for Review
(1) Points

True (*)

False

Correct Correct

10. Which of the following can be done using PL/SQL? Mark for
Review
(1) Points

Manage database tasks such as security

Create complex applications

Retrieve and modify data in Oracle database tables

Create custom reports

All of these can be done (*)

Correct Correct

Section 1 Quiz
(Answer all questions in this section)

1. Which of the following tools can NOT be used to develop and test
PL/SQL code? Mark for Review
(1) Points

Oracle Application Express

Oracle Jdeveloper
Oracle iSQL*Plus

Oracle JSQL (*)

Incorrect Incorrect. Refer to Section 1 Lesson 3.

2. In which part of the PL/SQL block are declarations of variables


defined? Mark for Review
(1) Points

Declarative (*)

Exception

Definition

Executable

Correct Correct

3. What is the purpose of using DBMS_OUTPUT.PUT_LINE in a PL/SQL


block? Mark for Review
(1) Points

To perform conditional tests

To store new rows in the database

To allow a set of statements to be executed repeatedly

To display results to check if our code is working correctly (*)

Correct Correct

4. Which lines of code will correctly display the message "The cat
sat on the mat"? (Choose two.) Mark for Review
(1) Points

(Choose all correct answers)


DBMS_OUTPUT.PUT_LINE('The cat sat ' || 'on the mat'); (*)

DBMS_OUTPUT.PUT_LINE('The cat sat on the mat'); (*)

DBMS_OUTPUT.PUT_LINE(The cat sat on the mat);

DBMS_OUTPUT.PUT_LINE('The cat' || 'sat on the mat');

Incorrect Incorrect. Refer to Section 1 Lesson 3.

5. In a PL/SQL block, which of the following should not be followed


by a semicolon? Mark for Review
(1) Points

END

DECLARE (*)

All PL/SQL statements

All SQL statements

Incorrect Incorrect. Refer to Section 1 Lesson 3.

Section 1 Quiz
(Answer all questions in this section)

1. Which of the following statements is true? Mark for Review


(1) Points

(Choose all correct answers)


PL/SQL is an Oracle proprietary, procedural, third-generation programming
language. (*)

SQL is an ANSI-compliant, nonprocedural, fourth-generation programming


language. (*)

PL/SQL is an ANSI-compliant, procedural programming language.

PL/SQL is an Oracle proprietary, procedural, fourth-generation programming


language.

Incorrect Incorrect. Refer to Section 1 Lesson 1.

2. The P in PL/SQL stands for: Mark for Review


(1) Points

Procedural (*)

Primary

Processing

Proprietary

Correct Correct

3. In which three ways does PL/SQL extend the SQL programming


language? Mark for Review
(1) Points

(Choose all correct answers)

By adding conditional control. (*)

By adding iterative control. (*)

By adding compound constructs.

By adding procedural constructs. (*)


Correct Correct

4. Third-generation programming languages include all except _____


and _____. Mark for Review
(1) Points

(Choose all correct answers)

C++

SQL (*)

Java

MySQL (*)

PL/SQL

Correct Correct

5. Which of the following statements is true? Mark for Review


(1) Points

You can embed procedural constructs within SQL code.

You can embed PL/SQL statements within SQL code.

You can embed SQL statements within PL/SQL code. (*)

None of these are correct.

Incorrect Incorrect. Refer to Section 1 Lesson 1.

6. Which of the following tools can NOT be used to develop and test
PL/SQL code? Mark for Review
(1) Points

Oracle Jdeveloper

Oracle JSQL (*)


Oracle iSQL*Plus

Oracle Application Express

Correct Correct

7. What is the purpose of using DBMS_OUTPUT.PUT_LINE in a PL/SQL


block? Mark for Review
(1) Points

To perform conditional tests

To display results to check if our code is working correctly (*)

To store new rows in the database

To allow a set of statements to be executed repeatedly

Correct Correct

8. How can you display results to check that a PL/SQL block is


working correctly? Mark for Review
(1) Points

You don't need to do anything, the results will display automatically.

Write a C or Java program to display the results

Use DBMS_OUTPUT.PUT_LINE (*)

Use an Exception section

Correct Correct

9. Which lines of code will correctly display the message "Hello


World" ? (Choose two.) Mark for Review
(1) Points

(Choose all correct answers)


DBMS_OUTPUT.PUT_LINE('Hello World'); (*)

DBMS_OUTPUT.PUT_LINE('Hello' || 'World');

DBMS_OUTPUT('Hello World');

DBMS_OUTPUT.PUT_LINE('Hello' || ' ' || 'World'); (*)

Correct Correct

10. Which statements are optional in a PL/SQL block? (Choose two.)


Mark for Review
(1) Points

(Choose all correct answers)

EXCEPTION (*)

END;

BEGIN

DECLARE (*)

11. Procedural constructs give you better control of your SQL


statements and their execution. True or False? Mark for Review
(1) Points

True (*)

False
Correct Correct

12. You can create a Web site application written entirely in PL/SQL.
True or False? Mark for Review
(1) Points

True

False (*)

Incorrect Incorrect. Refer to Section 1 Lesson 2.

13. Using Oracle Application Express, you can create Web applications
that include PL/SQL. True or False? Mark for Review
(1) Points

TRUE (*)

FALSE

Correct Correct

14. When multiple SQL statements are combined into PL/SQL blocks,
performance will typically improve. True or False? Mark for Review
(1) Points

True (*)

False

Correct Correct

15. The fact that PL/SQL is portable is a good thing because: Mark
for Review
(1) Points

PL/SQL code can be run on any operating system without a database

Blocks can be sent to the operating system.


Exceptions can be ported to different operating systems

PL/SQL code can be developed on one platform and deployed on another (*)

Section 1 Quiz
(Answer all questions in this section)

1. Which of the following is a PL/SQL programming environment? Mark


for Review
(1) Points

PL/SQL Express

Oracle Cdeveloper

Java*Plus

SQL*Workshop in Application Express (*)

Incorrect Incorrect. Refer to Section 1 Lesson 3.

2. This PL/SQL anonymous block will execute successfully. True or


False?
DECLARE
v_date DATE := SYSDATE;
DBMS_OUTPUT.PUT_LINE(v_date);
END;

Mark for Review


(1) Points

True

False (*)
Incorrect Incorrect. Refer to Section 1 Lesson 3.

3. Which lines of code will correctly display the message "Hello


World" ? (Choose two.) Mark for Review
(1) Points

(Choose all correct answers)

DBMS_OUTPUT.PUT_LINE('Hello World'); (*)

DBMS_OUTPUT.PUT_LINE('Hello' || 'World');

DBMS_OUTPUT.PUT_LINE('Hello' || ' ' || 'World'); (*)

DBMS_OUTPUT('Hello World');

Correct Correct

4. How can you display results to check that a PL/SQL block is


working correctly? Mark for Review
(1) Points

Write a C or Java program to display the results

You don't need to do anything, the results will display automatically.

Use an Exception section

Use DBMS_OUTPUT.PUT_LINE (*)

Correct Correct

5. In a PL/SQL block, which of the following should not be followed


by a semicolon? Mark for Review
(1) Points

All SQL statements

All PL/SQL statements


END

DECLARE (*)

Correct Correct

Section 1 Quiz
(Answer all questions in this section)

6. Which of the following statements is true? Mark for Review


(1) Points

You can embed procedural constructs within SQL code.

You can embed PL/SQL statements within SQL code.

None of these are correct.

You can embed SQL statements within PL/SQL code. (*)

Correct Correct

7. Nonprocedural languages allow the programmer to produce a result


when a series of steps are followed. True or False? Mark for Review
(1) Points

True

False (*)

Incorrect Incorrect. Refer to Section 1 Lesson 1.

8. SQL is a common access language for many types of databases,


including Oracle. True or False? Mark for Review
(1) Points

True (*)

False
Correct Correct

9. PL/SQL extends SQL by including all of the following except:


Mark for Review
(1) Points

reusable program units

constants

conditional statements

variables

nonprocedural constructs (*)

Incorrect Incorrect. Refer to Section 1 Lesson 1.

10. The P in PL/SQL stands for: Mark for Review


(1) Points

Proprietary

Processing

Primary

Procedural (*)

Correct Correct

Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 1 Quiz
(Answer all questions in this section)
11. When multiple SQL statements are combined into PL/SQL blocks,
performance will typically improve. True or False? Mark for Review
(1) Points

True (*)

False

Correct Correct

12. PL/SQL can be used not only with an Oracle database, but also
with any kind of relational database. True or False? Mark for Review
(1) Points

True

False (*)

Correct Correct

13. Comparing PL/SQL with other languages such as C and Java, which
of the following statements is true? Mark for Review
(1) Points

PL/SQL is harder to learn

PL/SQL is easier to learn and more efficient (*)

PL/SQL is easier to learn and does not require an Oracle database or tool

PL/SQL is easier to learn but less efficient

Correct Correct

14. Using Oracle Application Express, you can create Web applications
that include PL/SQL. True or False? Mark for Review
(1) Points

TRUE (*)
FALSE

Correct Correct

15. Which of the following can be done using PL/SQL? Mark for
Review
(1) Points

All of these can be done (*)

Create complex applications

Manage database tasks such as security

Create custom reports

Retrieve and modify data in Oracle database tables

Correct Correct

st: Section 1 Quiz


Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 1 Quiz
(Answer all questions in this section)

1. PL/SQL extends SQL by including all of the following except:


Mark for Review
(1) Points

nonprocedural constructs (*)

constants

reusable program units

variables
conditional statements

Correct Correct

2. The P in PL/SQL stands for: Mark for Review


(1) Points

Procedural (*)

Primary

Proprietary

Processing

Correct Correct

3. Nonprocedural languages allow the programmer to produce a result


when a series of steps are followed. True or False? Mark for Review
(1) Points

True

False (*)

Correct Correct

4. Third-generation programming languages include all except _____


and _____. Mark for Review
(1) Points

(Choose all correct answers)

SQL (*)

MySQL (*)

PL/SQL

Java
C++

Correct Correct

5. A program which specifies a list of operations to be performed


sequentially to achieve the desired result can be called: Mark for Review
(1) Points

low level

procedural (*)

nondeclarative

declarative

Correct Correct

Section 1 Quiz
(Answer all questions in this section)

6. Which sections of a PL/SQL block are optional? Mark for Review


(1) Points

Executable only

Exception only

Declaration and Exception (*)

Declaration and Executable

Correct Correct

7. Which lines of code will correctly display the message "Hello


World" ? (Choose two.) Mark for Review
(1) Points
(Choose all correct answers)

DBMS_OUTPUT.PUT_LINE('Hello' || ' ' || 'World'); (*)

DBMS_OUTPUT('Hello World');

DBMS_OUTPUT.PUT_LINE('Hello World'); (*)

DBMS_OUTPUT.PUT_LINE('Hello' || 'World');

Correct Correct

8. Given below are the parts of a PL/SQL block:


1. END;
2. EXCEPTION
3. DECLARE
4. BEGIN

Arrange the parts in order.

Mark for Review


(1) Points

2,1,4,3

3,2,4,1

4,3,2,1

3,4,2,1 (*)

Correct Correct

9. Which statements are mandatory in a PL/SQL block? (Choose two.)


Mark for Review
(1) Points

(Choose all correct answers)

END; (*)

BEGIN (*)
DECLARE

EXCEPTION

Correct Correct

10. Which of the following is NOT a PL/SQL programming environment?


Mark for Review
(1) Points

SQL Workshop in Application Express

SQL*Plus

gSQL*Plus (*)

Oracle jDeveloper

Correct Correct

Test: Section 1 Quiz


Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 1 Quiz
(Answer all questions in this section)

11. You can create a Web site application written entirely in PL/SQL.
True or False? Mark for Review
(1) Points

True

False (*)

Correct Correct

12. Which of the following can be done using PL/SQL? Mark for
Review
(1) Points

Create customized reports

Manage database security

Develop Web applications using the Web Application Toolkit

All of these can be done (*)

Update data (DML)

Correct Correct

13. When multiple SQL statements are combined into PL/SQL blocks,
performance will typically improve. True or False? Mark for Review
(1) Points

True (*)

False

Incorrect Incorrect. Refer to Section 1 Lesson 2.

14. Procedural constructs give you better control of your SQL


statements and their execution. True or False? Mark for Review
(1) Points

True (*)

False

Correct Correct

15. Which of the following can be done using PL/SQL? Mark for
Review
(1) Points

All of these can be done (*)


Retrieve and modify data in Oracle database tables

Manage database tasks such as security

Create complex applications

Create custom reports

Correct Correct

Section 2 Quiz
(Answer all questions in this section)

1. A variable defined in an outer block is global to the outer block


and local to the inner block. True or False? Mark for Review
(1) Points

True

False (*)

Incorrect Incorrect. Refer to Section 2 Lesson 6.

2. If a variable is defined with the same name in both an inner and


outer block, and referenced in the outer block, it will reference the ___________
block value of the variable. Mark for Review
(1) Points

Neither - can't define a variable with the same name in both blocks

Inner

Outer (*)
Incorrect Incorrect. Refer to Section 2 Lesson 6.

3. Reserved words can be used as identifiers. True or False? Mark


for Review
(1) Points

True

False (*)

Correct Correct

4. Valid identifiers begin with a _____. Mark for Review


(1) Points

Special character

Number

Letter (*)

Correct Correct

5. A function called FORMAT_TODAYS_DATE accepts no parameters and


returns today's date in the format: Month DD, YYYY
The following anonymous block invokes the function:

DECLARE
v_today DATE;
BEGIN
-- invoke the function here

Which of the following statements correctly assigns the date variable v_today to
the value returned by the format_todays_date function?

Mark for Review


(1) Points

format_todays_date := v_today('Month DD, YYYY');

v_today := TO_DATE(format_todays_date, 'Month DD, YYYY'); (*)


v_today := format_todays_date(v_today);

v_today := format_todays_date ('Month DD, YYYY');

Correct Correct

Test: Section 2 Quiz


Review your answers, feedback, and question scores below. An asterisk (*) indicates
a correct answer.

Section 2 Quiz
(Answer all questions in this section)

6. Variables can be assigned a value in both the Executable and


Declaration sections of a PL/SQL program. True or False? Mark for Review
(1) Points

True (*)

False

Correct Correct

7. Which explicit function is used to convert a character into a


number? Mark for Review
(1) Points

TO_NUMBER (*)

TO_CHAR

TO_DATE

Correct Correct

8. PL/SQL statements must be written on a single line. Mark for


Review
(1) Points

True
False (*)

Correct Correct

9. PL/SQL can convert a VARCHAR2 value containing alphabetic


characters to a NUMBER value. True or False? Mark for Review
(1) Points

True

False (*)

Correct Correct

10. Which of the following is a composite data type? Mark for


Review
(1) Points

VARCHAR2

CLOB

RECORD (*)

DATE

Incorrect Incorrect. Refer to Section 2 Lesson 3.

Section 2 Quiz
(Answer all questions in this section)

11. A Scalar data type holds a(n) ____ value. Mark for Review
(1) Points

Multi

Single (*)
image

Large

Correct Correct

12. If you use the %TYPE attribute, you can avoid hard-coding the
column name. True or False? Mark for Review
(1) Points

True

False (*)

Incorrect Incorrect. Refer to Section 2 Lesson 4.

13. You need to declare a variable to hold a value which has been
read from the SALARY column of the EMPLOYEES table. Which of the following is an
advantage of declaring the variable as: employees.salary%TYPE ? Mark for Review
(1) Points

It executes much faster than using NUMBER(8,2)

If the SALARY column is ALTERed later, the PL/SQL code need not be changed.
(*)

It allows the software to perform implicit data type conversions.

It is shorter than coding NUMBER(8,2)

Incorrect Incorrect. Refer to Section 2 Lesson 4.

14. Which of the following are examples of good programming practice?


(Choose two.) Mark for Review
(1) Points

(Choose all correct answers)

For clarity, use column names as identifiers.


Use meaningful names for identifiers. (*)

Declare one or more identifiers per line for improved performance.

Use the %TYPE attribute to declare a variable according to another previously


declared variable or database column. (*)

Incorrect Incorrect. Refer to Section 2 Lesson 7.

15. Comments change how a PL/SQL program executes, so an unsuitable


comment can cause the program to fail. True or False? Mark for Review
(1) Points

True

False (*)

Correct Correct

Correct Correct

Potrebbero piacerti anche