Database Development II Midterm Exam with Answers, Exams of Database Programming

A comprehensive set of multiple-choice questions and answers covering key concepts in database development ii. It explores topics such as sql, pl/sql, application models, data types, control structures, cursors, exceptions, and stored procedures. The questions are designed to test understanding of fundamental principles and practical applications in database development.

Typology: Exams

2024/2025

Available from 01/24/2025

Achieverr
Achieverr ๐Ÿ‡บ๐Ÿ‡ธ

4.2

(14)

20K documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
DATABASE DEVELOPMENT II
MIDTERM exam with answers
SQL is NOT a ____.
a. procedural language
b. programming language
c. language that allows the actions of the end user to be converted
into instructions that a computer can understand
d. language that allows us to add, delete, or change data in a database
- CORRECT ANSWERS โœ”โœ”a. procedural language
The term portability refers to the ability of PL/SQL to ____.
a. run on any platform that Oracle can run on
b. tighten security
c. automate tasks
d. group SQL statements before sending them to Oracle for execution
- CORRECT ANSWERS โœ”โœ”a. run on any platform that Oracle can run
on
A(n) ____ is a general framework or design that describes how the
various components of the application will be addressed.
a. programming language
b. database
c. procedural lang.uage
d. application model - CORRECT ANSWERS โœ”โœ”d. application model
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Database Development II Midterm Exam with Answers and more Exams Database Programming in PDF only on Docsity!

DATABASE DEVELOPMENT II

MIDTERM exam with answers

SQL is NOT a ____. a. procedural language b. programming language c. language that allows the actions of the end user to be converted into instructions that a computer can understand d. language that allows us to add, delete, or change data in a database

  • CORRECT ANSWERS โœ”โœ”a. procedural language The term portability refers to the ability of PL/SQL to ____. a. run on any platform that Oracle can run on b. tighten security c. automate tasks d. group SQL statements before sending them to Oracle for execution
  • CORRECT ANSWERS โœ”โœ”a. run on any platform that Oracle can run on A(n) ____ is a general framework or design that describes how the various components of the application will be addressed. a. programming language b. database c. procedural lang.uage d. application model - CORRECT ANSWERS โœ”โœ”d. application model

Which of the following can receive and return multiple values? a. Package b. Function c. Database trigger d. Procedure - CORRECT ANSWERS โœ”โœ”d. Procedure PL/SQL code that automatically runs when a particular button is clicked on the screen is an example of a(n) ____. a. function b.package c. procedure d. application trigger - CORRECT ANSWERS โœ”โœ”d. application trigger In a three-tier application model, the user interface is often referred to as a(n) ____. a,GUI b.OTN c. thin client d. program unit - CORRECT ANSWERS โœ”โœ”c. thin client ____ is a basic tool available with the Oracle server that allows a user to enter SQL and PL/SQL directly to the database server for processing. a. SQL*Plus b.OTN c. Procedure Builder

--ยท- executable statements -ยท END; c. DECLARE order NUMBER(2.) := 0.: departure DATE; BEGIN ---- executable statements -โ€ข END; d.DECLARE order NUMBER(2) CONSTANT:= .03; departure DATE; BEGIN ---- executable statements --โ€ข END; - CORRECT ANSWERS โœ”โœ”a.DECLARE order CONSTANT NUMBER(2,2) := .02; departure DATE; BEGIN ---- executable statements -โ€ข END; 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 N UMBER(2); BEGIN order := total_amt *12; END; d.DECLARE order NU MBER(2) .= 4; total_amt NUMBER(2); BEGIN total_amt := total_amt *12; END; - CORRECT ANSWERS โœ”โœ”b.DECLARE order NUMBER(2) := 4; total_amt NUMBER(2); BEGIN total_amt := 12 * order;

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; - CORRECT ANSWERS โœ”โœ”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; 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. ":=" should be "=" c. ELSEIF is not a keyword d. No space between ELSE and IF - CORRECT ANSWERS โœ”โœ”c. ELSEIF is not a keyword 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

-- executable code - END; DECLARE TYPE type_basket IS RECORD( basket bb_basket.idBasket%TYPE, created bb_basket.dtcreated%TYPE, total bb_basket.cost%TYPE, qty bb_basket.quantity%TYPE, sub bb_basket.subtotal%TYPE); rec_basket type_basket; BEGIN --- executable code --- END; According to the code fragment above, which variable is declared using the type_basket data type? a.basket b.qty c. sub d. rec_basket - CORRECT ANSWERS โœ”โœ”d. rec_basket Which of the following code fragments correctly uses a record variable to hold the row of data queried for a shopper? - CORRECT ANSWERS โœ”โœ”DECLARE rec_shopper bb_shopper%ROWTYPE;

BEGIN

SELECT*

INTO rec_shopper FROM bb_shopper WHERE idshopper = :g_shopper; DBMS_OUTPUT.PUT_LINE(rec_shopper.lastname); DBMS_OUTPUT.PUT_LINE(rec_shopper.address); DBMS_OUTPUT.PUT_LINE(rec_shopper.email); END; A(n) ____ is a variable that can handle many rows of data but only one field. a. associative array b. assignment statement c. collection d. table attribute - CORRECT ANSWERS โœ”โœ”a. associative array Which of the following associative array attributes checks to see if a value has been entered for the stated index number? a.COUNT b.PRIOR c. EXISTS d. FIRST - CORRECT ANSWERS โœ”โœ”c. EXISTS Which of the following is sometimes called a jumping control because it instructs programs to "jump to" some specific area of the code? a. GOTO statement

____ refers to a SELECT statement in a PL/SQL block that retrieves more than one row. a. NO_DATA_FOUND b. CASE_NOT_FOUND c. TOO_MANY_ROWS d. ZERO_DIVIDE - CORRECT ANSWERS โœ”โœ”c. TOO_MANY_ROWS ____ refers to a condition where there is no WHEN clause in the CASE statement. a. CASE_NOT_FOUND b. NO _DATA_FOUND c. ZERO_DIVIDE d. DUP _VAL_ON_INDEX - CORRECT ANSWERS โœ”โœ”a. CASE_NOT_FOUND ____ refers to an attempted violation of a unique or primary key column constraint. a. CASE_NOT_FOUND b. NO _DATA_FOUNO c. DUP_VAL_ON_INDEX d. TOO_MANY_ROWS - CORRECT ANSWERS โœ”โœ”c. DUP_VAL_ON_INDEX ____ is required in a PRAGMA EXCEPTION_INIT statement. a. INIT code b, Exception name

c. LOOP d, Predefined error - CORRECT ANSWERS โœ”โœ”b, Exception name A(n) ____ is one that a developer explicitly raises in the block to enforce a business rule. a. error b. user-defined exception c. predefined exception d. exception - CORRECT ANSWERS โœ”โœ”b. user-defined exception ____ is used to trap errors not specifically addressed in one of the exception handlers. a. EXIT WHEN b. EXCEPTION c. WHEN OTHERS d.WHERE - CORRECT ANSWERS โœ”โœ”c. WHEN OTHERS The ____ handler should always be the last handler listed in the EXCEPTION section of a block. a. TOO_MANY_ROWS b. EXIT WHEN c. WHEN OTHERS d.NO_DATA_FOUND - CORRECT ANSWERS โœ”โœ”c. WHEN OTHERS The ____ is an Oracle built-in procedure that allows developers to associate their own error number and message to an error.

____ is an example of a function. a,OUT b.ROUND C. IN OUT d.lN - CORRECT ANSWERS โœ”โœ”b.ROUND One important item that needs to be considered when creating stored procedures is to make them flexible so that they can be ____. a. triggered b.reused c. packaged d. executed - CORRECT ANSWERS โœ”โœ”b.reused ____ are mechanisms used to send values into and out of a program unit. a. Parameters b. Procedures c. Database triggers d. Packages - CORRECT ANSWERS โœ”โœ”a. Parameters The following code is considered to be a ____. CREATE OR REPLACE PROCEDURE total_calc_sp (p_basket IN bb_basket.idbasket%TYPE, p_total OUT bb_basket.total%TYPE := 0 )

IS

a. PL/SQL block b. DECLARE section c. function header section d. procedure header section - CORRECT ANSWERS โœ”โœ”d. procedure header section The DBMS_OUTPUT.PUT_LINE statement can be used to ____. a. assist with debugging your code b. assist with creating functions c. assist with the creation of an exception d. assist with the creation of a cursor - CORRECT ANSWERS โœ”โœ”a. assist with debugging your code ____are transactions created within another transaction. a. Autonomous transactions b. Pragma transactions c. Dynamic transactions d. Subprograms - CORRECT ANSWERS โœ”โœ”a. Autonomous transactions ____ is a compiler directive. a. EXCEPTION b.Pragma c. Subprogram