Database Programming Review Questions - 645 Verified Questions

Page 1


Database Programming Review Questions

Course Introduction

Database Programming covers the fundamental principles and practices of developing software applications that interact with relational databases. Students will learn how to design, implement, and maintain databases, utilizing SQL for data definition, manipulation, and query optimization. The course explores topics such as stored procedures, triggers, transaction management, database connectivity using programming languages like Java or Python, and best practices for ensuring data integrity and security. Through practical exercises and projects, students will gain hands-on experience in building robust, efficient, and scalable database-driven applications to address real-world data management challenges.

Recommended Textbook

Oracle 11G PL SQL Programming 2nd Edition by Joan

Available Study Resources on Quizplus

10 Chapters

645 Verified Questions

645 Flashcards

Source URL: https://quizplus.com/study-set/1149 Page 2

Chapter 1: Introduction To PL/SQL

Available Study Resources on Quizplus for this Chatper

54 Verified Questions

54 Flashcards

Source URL: https://quizplus.com/quiz/22517

Sample Questions

Q1) A procedure and function are named program units that are called to perform a specific task.

A)True

B)False

Answer: True

Q2) A(n) <u>package </u>is any block of PL/SQL code that has been named so that it can be saved and reused. _________________________

A)True

B)False

Answer: False

Q3) A(n) _____________________ performs a task automatically when a Data Manipulation Language (DML) action occurs on the associated table.

Answer: database trigger

Q4) The term ____________________ indicates the program unit is saved in the database, and therefore can be used or shared by different applications.

Answer: stored

Q5) A program that can run on any platform is considered ____________________. Answer: portable

To view all questions and flashcards with answers, click on the resource link above. Page 3

Chapter 2: Basic PL/SQL Block Structures

Available Study Resources on Quizplus for this Chatper

81 Verified Questions

81 Flashcards

Source URL: https://quizplus.com/quiz/22518

Sample Questions

Q1) 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

Answer: B

Q2) 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

Answer: A

To view all questions and flashcards with answers, click on the resource link above.

Page 4

Chapter 3: Handling Data In PL/SQL Blocks

Available Study Resources on Quizplus for this Chatper

51 Verified Questions

51 Flashcards

Source URL: https://quizplus.com/quiz/22519

Sample Questions

Q1) A scalar variable can hold multiple values whereas a composite variable can hold only a single value.

A)True

B)False

Answer: False

Q2) A disadvantage of using the %TYPE attribute is that there is a slight performance hit in that the database server must look up the data type from the data dictionary. A)True

B)False

Answer: True

Q3) The syntax of the following code fragment is correct. BEGIN

If lv_rows_num = 0 GOTO insert_row;

End If;

A)True

B)False

Answer: False

To view all questions and flashcards with answers, click on the resource link above. Page 5

Chapter 4: Cursors and Exception Handling

Available Study Resources on Quizplus for this Chatper

65 Verified Questions

65 Flashcards

Source URL: https://quizplus.com/quiz/22520

Sample Questions

Q1) A(n) ____________________ is one that a developer explicitly raises in the block to enforce a business rule.

Q2) The<u> SQLERRM</u> function returns the Oracle error number.

A)True

B)False

Q3) ____ refers to a SELECT statement in a PL/SQL block that retrieves more than one row.

A) NO_DATA_FOUND

B) ZERO_DIVIDE

C) CASE_NOT_FOUND

D) TOO_MANY_ROWS

Q4) The ____ is an Oracle built-in procedure that allows developers to associate their own error number and message to an error.

A) SQLCODE

B) SQLERRM

C) RAISE_APPLICATION_ERROR

D) WHEN OTHERS

Q5) Discuss the meaning of the term exception handler.

To view all questions and flashcards with answers, click on the resource link above. Page 6

Chapter 5: Procedures

Available Study Resources on Quizplus for this Chatper

75 Verified Questions

75 Flashcards

Source URL: https://quizplus.com/quiz/22521

Sample Questions

Q1) The ____ command can be used to list details about the structure of a procedure, such as information regarding the parameters.

A) UPDATE

B) DESCRIBE

C) TYPE

D) %TYPE

Q2) The RAISE_APPLICATION_ERROR built-in function is provided by Oracle to ____.

A) create error messages

B) display error messages

C) track error messages

D) display functions

Q3) The term<u> autonomous transaction</u> refers to additional instructions for the PL/SQL compiler to use during program unit compilation.

A)True

B)False

Q4) Three choices exist for parameter mode: INTO, OUT OF, and IN OUT.

A)True

B)False

Q5) What is the difference between a function and a procedure?

Page 7

To view all questions and flashcards with answers, click on the resource link above.

Chapter 6: Functions

Available Study Resources on Quizplus for this Chatper

51 Verified Questions

51 Flashcards

Source URL: https://quizplus.com/quiz/22522

Sample Questions

Q1) You can include multiple RETURN statements in the body of a function.

A)True

B)False

Q2) All of the following are purity level acronyms, except ____.

A) WNDS

B) RINDS

C) WNPS

D) RNPS

Q3) The RETURN statement in a function is used to control the flow of execution.

A)True

B)False

Q4) Formal parameters including the RETURN data type cannot include size information.

A)True

B)False

Q5) A(n) ____________________ cannot serve as an entire statement.

Q6) Deleting a program unit can be accomplished by issuing a(n) ____________________ command.

Q7) It is considered good form to return only one value from a function and to do so using the ____________________ statement.

To view all questions and flashcards with answers, click on the resource link above. Page 8

Chapter 7: PL/SQL Packages

Available Study Resources on Quizplus for this Chatper

68 Verified Questions

68 Flashcards

Source URL: https://quizplus.com/quiz/22523

Sample Questions

Q1) Items declared in the package body and not in the specification can be used only by other procedures and functions within this same package body.

A)True B)False

Q2) The ____________________ serves as a map to what program units are available in the package and the parameters of the program unit.

Q3) CREATE OR REPLACE PACKAGE metric_pkg IS cup_to_liter CONSTANT NUMBER := .24; Pint_to_liter CONSTANT NUMBER := .47; Qrt_to_liter CONSTANT NUMBER := .95; END;

Which of the following statements about the code fragment above is correct?

A) The CONSTANT option allows the values of the variables to be modified.

B) There is no need to create a body for this package.

C) Program units are included in the package.

D) The package body must be created.

Q4) Functions are used in CHECK constraints or as a default values of table columns. A)True B)False

Q5) Why would a package require two procedures or functions with the same name?

To view all questions and flashcards with answers, click on the resource link above. Page 9

Chapter 8: Program Unit Dependencies

Available Study Resources on Quizplus for this Chatper

61 Verified Questions

61 Flashcards

Source URL: https://quizplus.com/quiz/22524

Sample Questions

Q1) When a program unit includes references to database objects that in turn reference other database objects, it is said to contain direct dependencies.

A)True

B)False

Q2) If granted appropriate rights, it is possible to call database objects from other schemas.

A)True

B)False

Q3) Only program unit header modifications require a recompilation of dependent objects.

A)True

B)False

Q4) ____ can be used to check the status of database objects.

A) USER_OBJECTS

B) USER_REFERENCE

C) USER_CHECK

D) USER_SOURCE

Q5) If a dependent object is flagged as INVALID, this means that the program unit should be ____________________________.

To view all questions and flashcards with answers, click on the resource link above. Page 10

Chapter 9: Database Triggers

Available Study Resources on Quizplus for this Chatper

54 Verified Questions

54 Flashcards

Source URL: https://quizplus.com/quiz/22525

Sample Questions

Q1) A constraining table is one that is being modified by a DML action when a trigger is fired.

A)True

B)False

Q2) System triggers are typically used to allow the modification of data through a view on a view that is nonmodifiable.

A)True

B)False

Q3) Database system events include all of the following, except ____.

A) LOGON

B) SHUTDOWN

C) GRANT

D) STARTUP

Q4) Row level options are only applicable for ____ events.

A) CREATE

B) INSERT

C) DECLARE

D) UPDATE and DELETE

Q5) A(n) ___________________________ is a PL/SQL block that executes in place of a DML action on a database view.

To view all questions and flashcards with answers, click on the resource link above. Page 11

Chapter 10: Oracle-Supplied Packages, Dynamic SQL, and

Hiding Source Code

Available Study Resources on Quizplus for this Chatper

85 Verified Questions

85 Flashcards

Source URL: https://quizplus.com/quiz/22526

Sample Questions

Q1) What is the goal of dynamic SQL?

Q2) The basic mechanics of the alert process include registering an alert name, setting up when an alert should signal, and enabling the appropriate users to receive the alert.

A)True

B)False

Q3) All of the following procedures are included in the DBMS_ALERT package, except

A) REGISTER

B) SIGNAL

C) WAIT

D) WAITONE

Q4) Dynamic SQL allows us to employ a more object-oriented approach to modeling our database and applications.

A)True

B)False

Q5) The goal of SQL is to empower users with little or no query skills to be able to perform a variety of data queries.

A)True

B)False

To view all questions and flashcards with answers, click on the resource link above. Page 12

Turn static files into dynamic content formats.

Create a flipbook