Sunteți pe pagina 1din 11

Question 1

5 out of 5 points

According to the code fragment below, which variable is declared using the type_basket data type? 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; Answer Selected Answer: b. rec_basket Correct Answer: b. rec_basket Question 2 0 out of 5 points

According to the code fragment below, how many times does the loop iterate? DECLARE lv_cnt_num NUMBER :=1; BEGIN WHILE lv_cnt_num <= 5 LOOP DBMS_OUTPUT.PUT_LINE(lv_cnt_num); lv_cnt_num := lv_cnt_num + 1; END LOOP; END; / Answer Selected Answer: b. 4 Correct Answer: c. 5 Question 3 0 out of 5 points

Which of the following clauses ensures that a basic loop runs at least once? Answer Selected Answer: d. LOOP Correct Answer: a. EXIT WHEN Question 4 5 out of 5 points

Which of the following evaluates conditions and returns a value in an assignment statement? Answer Selected Answer: c. CASE expression Correct Answer: c. CASE expression Question 5 5 out of 5 points

The ____ uses the LOOP and END LOOP markers to begin and end the loop code. Answer Selected Answer: a. basic loop Correct Answer: a. basic loop

Question 6

0 out of 5 points

Which of the following statements is true? Answer Selected Answer: b. The WHEN clause of a CASE statement ends with "END CASE;". Correct Answer: c. The WHEN clause of a CASE expression does not end with a semicolon. Question 7 0 out of 5 points

Which of the statements in the code fragment below ensures that the loop executes at least once? 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; Answer Selected Answer: a. LOOP Correct Answer: c. EXIT WHEN lv_cnt_num >= 5; Question 8 0 out of 5 points

One major advantage of using ____ as part of the physical database is being able to retrieve multiple values with a query of a single column. Answer Selected Answer: c. index by tables Correct Answer: b. collections Question 9 5 out of 5 points

Which of the following code fragments correctly uses a record variable to hold the row of data queried for an employee? Answer Selected Answer: a. DECLARE rec_employee employees%ROWTYPE; BEGIN SELECT * INTO rec_employee FROM employees WHERE employee_id = :g_emp_id; DBMS_OUTPUT.PUT_LINE(rec_employee.last_name); DBMS_OUTPUT.PUT_LINE(rec_employee.first_name); DBMS_OUTPUT.PUT_LINE(rec_employee.email); END; Correct Answer: a. DECLARE rec_employee employees%ROWTYPE; BEGIN SELECT * INTO rec_employee FROM employees WHERE employee_id = :g_emp_id; DBMS_OUTPUT.PUT_LINE(rec_employee.last_name); DBMS_OUTPUT.PUT_LINE(rec_employee.first_name);

DBMS_OUTPUT.PUT_LINE(rec_employee.email); END; Question 10 5 out of 5 points

Which of the clauses in the code fragment below would not cause the IF statement to raise an error if it were excluded? 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; Answer Selected Answer: a. ELSE Correct Answer: a. ELSE Question 11 5 out of 5 points

Which of the following statements is correct? Answer Selected Answer: c. The CONTINUE statement cannot appear outside a loop at all. Correct Answer: c. The CONTINUE statement cannot appear outside a loop at all. Question 12 5 out of 5 points

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; Answer Selected Answer: c. ELSEIF is not a keyword Correct Answer: c. ELSEIF is not a keyword Question 13 0 out of 5 points

Which of the following statements about collections is NOT true? Answer Selected Answer: d. The values in each row of the collection must be of the same type. Correct Answer: c. A collection may hold many rows of data and many fields. Question 14 5 out of 5 points

Which of the following code fragments would not raise an error? Answer Selected Answer:

b. IF rec.state = 'VA' OR rec.state = 'PA' THEN x := y * .06; ELSE x := y * .04; END IF; Correct Answer: b. IF rec.state = 'VA' OR rec.state = 'PA' THEN x := y * .06; ELSE x := y * .04; END IF; Question 15 5 out of 5 points

Which of the following code fragments correctly creates a record data type that will hold four variables? Answer Selected Answer: d. DECLARE TYPE type_basket IS RECORD ( basket bb_basket.idBasket%TYPE, created bb_basket.dtcreated%TYPE, qty bb_basket.quantity%TYPE, sub bb_basket.subtotal%TYPE ); rec_basket type_basket; BEGIN --- executable code --END; Correct Answer: d. DECLARE TYPE type_basket IS RECORD ( basket bb_basket.idBasket%TYPE, created bb_basket.dtcreated%TYPE, qty bb_basket.quantity%TYPE, sub bb_basket.subtotal%TYPE ); rec_basket type_basket; BEGIN --- executable code --END; Question 16 5 out of 5 points

Evaluate the following PL/SQL block. DECLARE v_sum_sal NUMBER(10,2) NOT NULL; BEGIN v_sum_sal := SUM(employees.salary); DBMS_OUTPUT.PUT_LINE('The sum of salary is '|| v_sum_sal); END; / Which of the followings is true about this block? Answer Selected Answer: b. Group functions cannot be used in PL/SQL syntax.

Correct Answer: b. Group functions cannot be used in PL/SQL syntax.

Question 17

5 out of 5 points

Which of the following statements is true about the statement given below? Assume that there is only one employee with employee id 100 and the statement is executed in a PL/SQL block. SELECT hire_date, salary, last_name INTO v_hire, v_sal, v_last FROM employees WHERE employee_id = 100; Answer Selected Answer: b. The statement creates an implicit cursor. Correct Answer: b. The statement creates an implicit cursor. Question 18 5 out of 5 points

Evaluate the following PL/SQL block. DECLARE v_weight NUMBER(3) := 600; v_message VARCHAR2(255) := 'Product 10012'; BEGIN DECLARE v_weight NUMBER(3) := 1; v_message VARCHAR2(255) := 'Product 11001'; v_new_locn VARCHAR2(50) := 'Europe'; BEGIN v_weight := v_weight + 1; v_new_locn := 'Western ' || v_new_locn; Position 1 >>>>>>>>> END; v_weight := v_weight + 1; v_message := v_message || ' is in stock'; v_new_locn := 'Western ' || v_new_locn; END; / What is the value of v_weight at position 1? Answer Selected Answer: d. 2 Correct Answer: d. 2 Question 19 5 out of 5 points

Evaluate the following PL/SQL block. DECLARE v_customer VARCHAR2(50) := 'Womansport'; v_credit_rating VARCHAR2(50) := 'EXCELLENT'; BEGIN

DECLARE v_customer NUMBER(7) := 201; v_name VARCHAR2(25) := 'Unisports'; BEGIN v_credit_rating :='GOOD'; ..... END; ..... END; / What is the value of v_credit_rating in the main block? Answer Selected Answer: c. GOOD Correct Answer: c. GOOD Question 20 0 out of 5 points

Assume that the value of test1 is 5 and the value of test2 is NULL. What is the value of test3 in the PL/SQL statement below? test3 := test1 > test2; Answer Selected Answer: a. boolean Correct Answer: d. NULL Question 21 5 out of 5 points

Evaluate the following PL/SQL block. Which of the following is correct value of variable v_weight at position 1 according to the rules of scoping? DECLARE v_weight NUMBER(3) := 600; v_message VARCHAR2(255) := 'Product 10012'; BEGIN DECLARE v_weight NUMBER(3) := 1; v_message VARCHAR2(255) := 'Product 11001'; v_new_locn VARCHAR2(50) := 'Europe'; BEGIN v_weight := v_weight + 1; v_new_locn := 'Western ' || v_new_locn; END; v_weight := v_weight + 1; v_message := v_message || ' is in stock'; v_new_locn := 'Western ' || v_new_locn; position 1-------------END; / Answer Selected Answer: c. 601 Correct Answer: c. 601 Question 22 5 out of 5 points

Which of the following is true about this PL/SQL block? DECLARE sal_increaseemployees.salary%TYPE := 800; BEGIN UPDATE employees SET salary := salary + sal_increase WHERE job_id = 'ST_CLERK'; END; / Answer Selected Answer: c. The block generates a syntax error. Correct Answer: c. The block generates a syntax error. Question 23 5 out of 5 points

The ________ clause is mandatory and is placed between the SELECT and FROM clauses. Answer Selected Answer: b. INTO Correct Answer: b. INTO Question 24 5 out of 5 points

Examine the structures of the TEXT_TAB1 and TEXT_TAB2 tables. (Both have the same structure.) Name TEXT_ID DOC Null? Type NUMBER CLOB

You issue the following INSERT commands: INSERT INTO text_tab1 VALUES (1, 'This is the first document'); INSERT INTO text_tab1 VALUES (2, 'This is the second document'); INSERT INTO text_tab2 VALUES (1, 'This is the addendum'); Evaluate the following SQL statements: SELECT * FROM text_tab1 WHERE SUBSTR(doc, 14, 2) LIKE '%i%'; SELECT DISTINCT doc from text_tab1; SELECT tab1.text_id FROM text_tab1 tab1 JOIN text_tab2 tab2 ON (tab1.doc = tab2.doc); SELECT COUNT(*) FROM text_tab1 WHERE doc = NOT NULL; Which of the above SQL statements execute successfully? Answer Selected Answer: a. statement 1 Correct Answer: a. statement 1 Question 25 5 out of 5 points

Which of the following statement types is directly supported by PL/SQL? Answer Selected Answer: a. Data Manipulation Language (DML) Correct Answer: a. Data Manipulation Language (DML) Question 26 5 out of 5 points

Evaluate the following PL/SQL block. Which of the following is correct value of variable v_new_locn at position 1 according to the rules of scoping? DECLARE v_weight NUMBER(3) := 600; v_message VARCHAR2(255) := 'Product 10012'; BEGIN DECLARE v_weight NUMBER(3) := 1; v_message VARCHAR2(255) := 'Product 11001'; v_new_locn VARCHAR2(50) := 'Europe'; BEGIN v_weight := v_weight + 1; v_new_locn := 'Western ' || v_new_locn; position 1-------------END; v_weight := v_weight + 1; v_message := v_message || ' is in stock'; v_new_locn := 'Western ' || v_new_locn; END; / Answer Selected Answer: d. Western Europe Correct Answer: d. Western Europe Question 27 5 out of 5 points

Which of the following functions is available only in SQL statements in a PL/SQL block? Answer Selected Answer: c. AVG Correct Answer: c. AVG Question 28 5 out of 5 points

Evaluate the following PL/SQL block. DECLARE v_weight NUMBER(3) := 600; v_message VARCHAR2(255) := 'Product 10012'; BEGIN DECLARE v_weight NUMBER(3) := 1; v_message VARCHAR2(255) := 'Product 11001'; v_new_locn VARCHAR2(50) := 'Europe'; BEGIN v_weight := v_weight + 1; v_new_locn := 'Western ' || v_new_locn; END; v_weight := v_weight + 1; v_message := v_message || ' is in stock'; v_new_locn := 'Western ' || v_new_locn; Position 1 >>>>>>>>>

END; / What is the value of v_new_locn at position 1? Answer Selected Answer: d. None of the above. The v_new_locn variable is not visible outside the subblock. Correct Answer: d. None of the above. The v_new_locn variable is not visible outside the subblock. Question 29 5 out of 5 points

Evaluate the following PL/SQL block. DECLARE mgr_no NUMBER(6) := 122; BEGIN DELETE FROM employees WHERE manager_id = mgr_no; DBMS_OUTPUT.PUT_LINE('Number of employees deleted: ' || TO_CHAR(?????)); END; / Which of the followings should be replaced with ????? to return the expected result? Answer Selected Answer: a. SQL%ROWCOUNT Correct Answer: a. SQL%ROWCOUNT Question 30 5 out of 5 points

Which of the following should be placed in a PL/SQL block that selects the maximum department ID in the departments table and stores it in the v_max_deptno variable? Answer Selected Answer: c. SELECT MAX(department_id) INTO v_max_deptno FROM departments; Correct Answer: c. SELECT MAX(department_id) INTO v_max_deptno FROM departments; Question 31 5 out of 5 points

A(n) ____ of data typically includes a number of different fields. Answer Selected Answer: a. row Correct Answer: a. row Question 32 5 out of 5 points

The variable name ____ conforms to Oracle naming standards. Answer Selected Answer: b. ship_date Correct Answer: b. ship_date Question 33 5 out of 5 points

Which of the following is a legal declaration statement? Answer

Selected Answer: b. DECLARE test NUMBER(5); Correct Answer: b. DECLARE test NUMBER(5); Question 34 5 out of 5 points

Which of the following sections is mandatory in a PL/SQL block? Answer Selected Answer: b. An executable section which begins with the keyword BEGIN and ends with END. Correct Answer: b. An executable section which begins with the keyword BEGIN and ends with END. Question 35 5 out of 5 points

Which of the following constraints must be used if a variable must hold a value? Answer Selected Answer: b. NOT NULL Correct Answer: b. NOT NULL Question 36 5 out of 5 points

A(n) ________ variable is one that exists in the application environment and can range from a field on an application screen to an SQL*Plus variable. Answer Selected Answer: b. host Correct Answer: b. host Question 37 5 out of 5 points

The statements that are used to control the flow of logic processing in your programs are commonly referred to as ____. Answer Selected Answer: b. control structures Correct Answer: b. control structures Question 38 5 out of 5 points

The ____ section of a PL/SQL block contains code that creates variables, cursors, and types. Answer Selected Answer: a. DECLARE Correct Answer: a. DECLARE Question 39 5 out of 5 points

The ____ markers are used in PL/SQL to identify a label. Answer Selected Answer: c. << >> Correct Answer: c. << >> Question 40 5 out of 5 points

Which of the following is a valid identifier? Answer Selected Answer: d. number1to7

Correct Answer: d. number1to7

S-ar putea să vă placă și