永发信息网

PLSQL题目,帮忙答下

答案:1  悬赏:80  手机版
解决时间 2021-06-01 22:23

1. It is good programming practice to create identifiers having the same name as column names. True or False?

a) 对

b) 错

2. Which SQL statements can be used directly in a PL/SQL block? (Choose two.)

a) GRANT EXECUTE ON ...

b) SELECt * INTO ...

c) REVOKE SELECT ON ...

d) UPDATE employees SET...

e) ALTER TABLE employees ...

3. When used in a PL/SQL block, which SQL statement must return exactly one row?

a) INSERT

b) UPDATE

c) SELECT

d) MERGE

e) DELETE

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.

c) Where possible, declare variables using the %TYPE attribute.

d) Specify the same number of variables in the INTO clause as database columns in the SELECT clause.

5. Which one of these SQL statements can be directly included in a PL/SQL executable block?

a) IF... THEN...;

b) INSERT INTO ...;

c) SELECT * FROM DUAL;

d) SHOW USER;

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.

7. What will happen when the following block is executed?

DECLARE

v_last employees.last_name%TYPE;

v_first employees.first_name%TYPE;

v_salary employees.salary%TYPE;

BEGIN

SELECT first_name, last_name

INTO v_first, v_last, v_salary

FROM employees WHERe employee_id=100;

END;

a) The block will fail because the SELECt statement returns more than one row.

b) The block will fail because the SELECT is trying to read two columns into three PL/SQL variables.

c) The block will fail because V_LAST was declared before V_FIRST.

d) The block will execute successfully, and the V_SALARY variable will be set to NULL.

8. Does PL/SQL allow you to have a variable with the same name as a database column?

a) No

b) Yes

9. Examine the following code:

DECLARE

CURSOR country_curs IS

SELECT country_id, country_name

FROM wf_countries

ORDER BY country_name;

v_country country_curs%ROWTYPE;

BEGIN

OPEN country_curs;

LOOP

FETCH country_curs INTO v_country;

EXIT WHEN country_curs%NOTFOUND;

------- Line A

END LOOP;

CLOSE country_curs;

END;

You want to display the id and name of each FETCHed country. What would you code at Line A?

a) DBMS_OUTPUT.PUT_LINE(country_id || ' ' || country_name);

b) DBMS_OUTPUT.PUT_LINE(v_country(country_id) || ' ' || v_country(country_name));

c) DBMS_OUTPUT.PUT_LINE(country_curs.country_id || ' ' || country_curs.country_name);

d) DBMS_OUTPUT.PUT_LINE(v_country.country_id || ' ' || v_country.country_name);

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;

11. How must you reference one field which is part of a PL/SQL record?

a) field_name.record_name

b) record_name.field_name

c) record_name(field_name)

d) field_name OF record_name

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

13. Which of the following explicit cursor attributes evaluates to TRUE if the most recent FETCH returns a row?

a) %ISOPEN

b) %NOTFOUND

c) %FOUND

d) %ROWCOUNT

14 You can reference explicit cursor attributes directly in a SQL statement. True or False?

a) 对

b) 错

15. Look at these declarations:

DECLARE

CURSOR dept_loc_cursor IS

SELECt department_id, department_name, location_name

FROM departments d, locations l

WHERe d.location_id = l.location_id;

v_dept_loc dept_loc_cursor%ROWTYPE;

How many fields does V_DEPT_LOC contain?

a) Two, because the cursor joins two tables

b) Four

c)Three

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 (*)

最佳答案
1,选择b,不能创建相同的列名。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
幻想世界急急急
双色球2009134期中奖号码
汽车上EBD是什么意思
想考二级建造师证书,但学的不是那个专业还有
我看到一个女孩,我很喜欢她,但是我不知道该
醉酒说话可信吗
我下的DNF最新版为啥更新后玩不成
笨鸟广告怎么去啊,有知道地址的么
请问海贼王里是青稚厉害还是黄猿厉害啊
怀孕三个月了,为什么心情时好时坏,感到好累
诺基亚6700s 和 索尼爱立信U100i(Yari)哪个
什么样的鼻子可以做整形手术?
谁能帮我下载咬文嚼字全集啊?
《礼物》的歌词是什么?刘力扬的那首
电脑组装视频
推荐资讯
我安的2M的宽带,怎么用迅雷下载东西,最快也
e63待机如何?
车在什么情况下容易翻车
鞍山哪有唱下午厂便宜的
改不了密码了啊
高考作文怎么写?
他曾经不是好人 但已经改过 可以爱他吗
DNF怎样取消DNF输入法,就是DNF打字的哪个
为什么会出现好友服务器不稳定?
听说DNF体验服开放了,我想知道这次每天有限
和一个性格内向的人该如何相处呢
衡阳最高的楼是多少层?
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?