4.Which one of the following is NOT a valid guideline for retrieving data in PL/SQL?
a) Terminate the SQL statement with a semicolon (;)
b) Do NOT use a WHERe clause in SELECt statements.
6. Look at this PL/SQL block:
DECLARE
v_count NUMBER;
BEGIN
SELECT COUNT(*) INTO v_count
FROM employees WHERe salary > 50000;
END;
No employees earn more than $50000. Which of the following statements are true? (Choose two). (选择所有正确答案)
a) The SELECt will return value 0 into V_COUNT.
b) The SELECT will fail because it does NOT return exactly one row.
c) The block will fail because variable V_SALARY was not declared.
d) The SELECT returns exactly one row.
e) The block will fail because no results are displayed to the user.
8. Does PL/SQL allow you to have a variable with the same name as a database column?
a) No
b) Yes
c) Where possible, declare variables using the %TYPE attribute.
10. You have declared the following cursor:
CURSOR country_curs IS
SELECT * FROM wf_countries
ORDER BY country_name;
There are over 200 rows in the WF_COUNTRIES table, but you want to fetch and display only the first 25 rows.
How would you exit from the FETCH loop?
a) EXIT WHEN country_curs%FOUND(25);
b) EXIT WHEN country_curs%ROWCOUNT > 25;
c) EXIT WHEN ROWCOUNT > 25;
d) WHEN country_curs > 25 THEN EXIT; END IF;
d) Specify the same number of variables in the INTO clause as database columns in the SELECt clause.
12. Look at the following code:
DECLARE
CURSOR emp_cursor IS
SELECT employee_id, last_name, salary FROM employees;
v_empcurs emp_cursor%ROWTYPE;
What is the data type of V_EMPCURS?
a) Scalar
b) Record
c) Cursor
d) Row
14 You can reference explicit cursor attributes directly in a SQL statement. True or False?
a) 对
b) 错
16. Table candidates contains a CLOB column named job_appl, which already contains data values. Which of the following methods can be used to modify the CLOB column values? (Choose two.) (选择所有正确答案)
a) UPDATe candidates SET job_appl = 'new value';
b) Use DBMS_LOB.PUT in a PL/SQL block
c) UPDATE candidates SET substr(job_appl,500,9) = 'new value';
d) Use DBMS_LOB.WRITE in a PL/SQL block
17. Which of the following is NOT a benefit of using LOB datatypes?
a) They can store very large data values
b) They can store many different kinds of data, including text articles, movies, audio and photos
c) They are easier to program in PL/SQL than CHAR and VARCHAR2
d) LOB data can be stored inside or outside the database
18. Internal LOB values are stored inside the database and external LOB values are stored outside the database. True or False?
a) 对
b) 错
19. Converting a column from LONG RAW to BLOB can take a long time if the table contains millions of rows, because every one of the LONG RAW values must be copied and converted
a) 对
b) 错
20. Which of the following are NOT LOB datatypes? (Choose two.) (选择所有正确答案)
a) CLOB
b) JPEG (*)
c) BFILE
d) MP3 (*)