22 0 432 KB
Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 2 Quiz (Answer all questions in this section) 11. Which of the following are required when declaring a variable? (Choose two.)
Mark for Review (1) Points
(Choose all correct answers) NOT NULL CONSTANT Data type (*) Identifier name (*) Correct 12. Which of the following are examples of good programming practice? (Choose three.)
Mark for Review (1) Points
(Choose all correct answers) Document code with comments. (*) Use table column names as the names of variables. Indent code so that it can be read more easily. (*) Develop naming conventions for identifiers and other objects. (*) Use implicit data type conversions. Correct 13. Which of the following will help to make code easier to read?
Mark for Review (1) Points
Naming variables. Using %Type. Including comments in the code. (*) Incorrect. Refer to Section 2 Lesson 7. 14. Which of the following are scalar data types? (Choose three.)
Mark for Review (1) Points
(Choose all correct answers) Character (*)
Table Array Boolean (*) Date (*) Correct 15. A movie is an example of which category of data type?
Mark for Review (1) Points
Composite Reference Scalar LOB (*) Correct Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 2 Quiz (Answer all questions in this section) 6. PL/SQL can implicitly convert a CHAR to a NUMBER, provided the CHAR contains a numeric value, for example '123'. True or False?
Mark for Review (1) Points
True (*) False Correct 7. What is wrong with this assignment statement?
myvar := 'To be or not to be';
Mark for Review (1) Points
'That is the question'; "myvar" is not a valid name for a variable Character literals should not be enclosed in quotes Nothing is wrong, the statement is fine An assignment statement must be a single line of code An assignment statement must have a single semicolon at the end (*) Correct 8. Which of the following are valid identifiers? (Choose two.)
Mark for Review (1) Points
(Choose all correct answers) completion_% v_code (*) students_street_address (*) #hours Full Name Correct 9. Delimiters are _____ that have special meaning to the Oracle database.
Mark for Review (1) Points
symbols (*) identifiers variables Correct 10. Is the following variable declaration correct or not?
Mark for Review (1) Points
DECLARE name, dept VARCHAR2(14); Correct. Not correct. (*) Correct Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer. Section 2 Quiz (Answer all questions in this section) 1. Which of the following declarations is invalid?
Mark for Review (1) Points
v_count PLS_INTEGER:=0; v_pages CONSTANT NUMBER; (*) v_start_date DATE := sysdate+1; college_name VARCHAR2(20):='Harvard'; Correct
2. If you are using the %TYPE attribute, you can avoid hard coding the:
Mark for Review (1) Points
Constraint Data type (*) Table name Column name Correct 3. What will be displayed when the following code is executed? DECLARE varA NUMBER := 12; BEGIN DECLARE varB NUMBER := 8; BEGIN varA := varA + varB; END; DBMS_OUTPUT.PUT_LINE(varB); END;
Mark for Review (1) Points
12 VarB 20 Nothing, the block will fail with an error (*) 8 Correct 4. What will be displayed when the following code is executed? DECLARE x VARCHAR2(6) := 'Chang'; BEGIN DECLARE x VARCHAR2(12) := 'Susan'; BEGIN x := x || x; END; DBMS_OUTPUT.PUT_LINE(x); END; Chang (*) SusanChang The code will fail with an error Susan ChangChang Correct
Mark for Review (1) Points
5. Examine the following code: DECLARE x VARCHAR2(20); BEGIN x:= 5 + 4 * 5 ; DBMS_OUTPUT.PUT_LINE(x); END; What value of x will be displayed? 29 25 (*) 45 14 Correct
Mark for Review (1) Points