










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 18
This page cannot be seen from the preview
Don't miss anything!











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