1. 英文邮件写作

先需要发一封邮件给客户,就一些需求的讨论确定一个会议时间,我们这边在周三下午和周五早上有空,讯问客户的空闲时间。

Dear all,

Good day!

Thank you for your last email!

We have got your general demand. And for deep understanding, we suggest to have a meeting together to discuss more details about it.

Wednesday afternoon and Friday morning this week are the available time for us. Would you please offer the feedback whether they are also convenient for you? If both not, please help offer your available time list. And we will try to book another time for this meeting and reply to you.

If any further questions, please feel free to contact us.

We are looking forward to your kind reply.

Thank you & Best regards!

Jay Cui

2. 测试题A

1) Other than Function, what other types of PL/SQL code blocks can be stored in the database?

Answers:

PROCEDURE 过程, PACKAGE 包

2) Define a LOOP statement that increments a variable “var_count” by 1 from 1 to 10.

Answers:

DECLAREvar_i INT:=1;var_count INT:=0;
BEGINLOOPvar_count:=var_count+var_i;EXIT WHEN var_i=10;var_i:=var_i+1;---步长为1END LOOP;
END;

3) Define a LOOP statement that retrieves all rows using the CURSOR defined in Question(4) above and define a VARIABLE “var_rows” that counts the number of rows retrieved.
Answers:

DECLAREvar_rows INT:=0;var_ID Customer.ID%TYPE;---初始化CURSOR ID_norder ISSELECT Distinct A.ID FROM Customer AWHERE NOT EXISTS(SELECT 1 FROM Order_entry BWHERE A.ID=B.ID);
BEGINOPEN ID_norder;LOOPFETCH ID_norder into var_ID;EXIT WHEN ID_norder%NOTFOUND;---DBMS_OUTPUT.PUT_LINE(var_ID);END LOOPvar_rows:=ID_norder%ROWCOUNT;----行数CLOSE ID_norder;
END;

4) If you have given 2 tables: Customer table and Order entry table

Customer table contains Customer ID, customer name
Order entry table contains Customer ID, order number, Item ordered, quantity
Not all the customer has a record in Order entry table.
Please construct a SQL statement to retrieve all customers ID which does not have a record in order entry table.

Answers:

SELECT Distinct A.ID FROM Customer A
WHERE NOT EXISTS(SELECT 1 FROM Order_entry BWHERE A.ID=B.ID);

5) There are 2 tables: Table A and Table B. Table A has 10 records. Table B has 3 records. How may records will the following SQL statement produce?

Select * from A,B

Answers: 30

3. 测试题B

1) a. How does a bulk operation improve PL/SQL performance?
b. Write a section of code that performs a BULK COLLECT which makes use of the following explicit cursor:

CURSOR c_data ISSELECT *FROM table_data;

Answers:

a.
For one code block, PL/SQL engine is responsible to handle procedural scripts, while SQL engine handles SQL scripts and offers feedback to PL/SQL.
In default situation, the engine switch/feedback process will be handled for each record. So the time consuming and efficiency will be not desirable when the count of records is huge.
Bulk operation offers the service to set the engine switch into bundle handling. So in the ideal situation, for all records, only one feedback cycle needs to be finished. The efficiency is improved obviously.

---b.
DECLARETYPE a_data IS TABLE OF table_data%ROWTYPE;b_data a_data:=a_data();---初始化CURSOR c_data ISSELECT * FROM table_data;
BEGINOPEN c_data;FETCH c_data BULK COLLECT INTO b_data;CLOSE c_data;
END;

2) Assuming we have an SQL DML statement into a table column. Write a section of code that fetches all the rows of the table “tab_command” and dynamically executes the SQL statement that is stored in column “sql_cmd” from this table.
desc TAB_COMMAND
Name Type
—— ——
sql_cmd VARCHAR2(100)

Answers:

DECLAREsql_exc tab_command.sql_cmd%TYPE;CURSOR sql_script ISSELECT sql_cmd FROM tab_command;
BEGINOPEN sql_script;LOOPFETCH sql_script into sql_exc;EXIT WHEN sql_script%NOTFOUND;EXECUTE IMMEDIATE sql_exc;COMMIT;END LOOP;
END;

3) Assuming our system uses a special date(e.g Thai year) and date conversion function that are called frequently from many other PL/SQL programs. What would be a good way to improve the performance of the date conversion functions?
Answers:

a) 标量子查询scalar subquery
b) RESULT_CACHE
c) deterministic

4) a.What is the difference between definer and invoker execution of a stored routine?
b. By default, is a routine stored in a database executed by definer rights or invoker rights?

Answers:

a.
1) To execute store routines, the privileges of definer are same. For invokers, they could have different privileges.
2) Through definer rights to execute store routines, the current user’s role is invalid. And invoker rights are what current users have.

b. Definer Rights

http://www.360doc.com/content/16/0901/11/7662927_587490185.shtml

成都笔试——PL/SQL准备相关推荐

  1. Oracle数据库之PL/SQL程序基础设计

    一.PL/SQL块结构 前边我们已经介绍了PL/SQL块的结构,再来回顾一下: DECLARE /** 声明部分--定义常量.变量.复杂数据类型.游标.用户自定义异常*/ BEGIN /** 执行部分 ...

  2. 视频教程-赵强老师:Oracle数据库从10g到11g(4)PL/SQL编程基础-Oracle

    赵强老师:Oracle数据库从10g到11g(4)PL/SQL编程基础 毕业于清华大学,拥有超过13年的工作经验. Oracle认证讲师,拥有6年以上授课经验.精通Oracle数据库.中间(Weblo ...

  3. PL/SQL Developer(解压版)连接64位的Oracle11g

    PL/SQL Developer(解压版)连接64位的Oracle11g 在Windows 64位系统上安装64位的Oracle数据库,但是没有对应的64位PL/SQL Developer,此时要用P ...

  4. oracle pl/sql 程序设计 历史笔记整理

    20131016 周三 oracle pl/sql 程序设计 第2章 创建并运行pl/sql代码 sqlplus yjkhecc/yjkhecc@10.85.23.92:1521/orcl 在java ...

  5. PL/SQL ——分页编程

    通过PL/SQL编程,编写分页存储过程.代码如下所示: 1 --PL/SQL开发编写分页代码 2 --创建包 3 create or replace package Page as 4 type te ...

  6. PL/SQL学习笔记-常量变量及数据类型初步

    一:常量和变量 开始之前,还是照例做个经典的例子,如下: declare mydate varchar2(16) := 'hellow world'; begindbms_output.put_lin ...

  7. oracle bl编译,使用 PL/SQL 条件编译

    预处理器指令 指令由指令控制标记"$"和普通的 PL/SQL 文本组成.条件编译使用三个指令:选择.查询和错误.特殊的触发器字符"$"代表条件编译指令.选择指令 ...

  8. PL/SQL集合类型的整理学习

    http://log-cd.iteye.com/blog/521177 PL/SQL集合类型是类似于高级语言数组的一种复合数据类型,集合类型包括索引表(PL/SQL表).嵌套表(Nested Tabl ...

  9. PL/SQL 中Returning Into的用法

    ORACLE的DML语句中可以指定RETURNING INTO语句.RETURNING INTO语句的使用在很多情况下可以简化PL/SQL编程,少一次select into语句. DELETE操作:R ...

最新文章

  1. 5、MySQL通用查询日志(General Query Log)
  2. 1.16 项目实例:Java图书信息查询
  3. Windows 10全新界面要来了:焕然一新!
  4. Horizon View 6-客户端连接虚拟桌面⑹
  5. jeecms添加站点
  6. 有道词典总显示无法连接服务器,有道词典无法联网提示网络已断开该怎么办
  7. Python稳基修炼的经典案例4(计算机二级、初学者必须掌握的例题)
  8. Android学习--10-数据存储
  9. Python数据分析《黑客帝国》-一切都不是偶然
  10. html面试信息登记表
  11. ubuntu samba Windows共享 你可能没有权限访问网络资源
  12. 通过检查table_locks_waited和table_locks_immediate状态变量来分析系统上的表锁定争夺
  13. 给你一个数组 nums 。数组「动态和」的计算公式为:runningSum[i] = sum(nums[0]…nums[i]) 。 请返回 nums 的动态和。 来源:力扣(LeetCode) 链
  14. Ubuntu网络环境配置
  15. oracle select ora-16000,ORA-00604, ORA-16000: 打开数据库以进行只读访问
  16. 客户端与服务器交互的功能,如何进行测试?
  17. 腾讯云域名证书下载_备案域名证书获取
  18. css使两个盒子并列_盒子模型(重点)
  19. 关于BCB的安装过程
  20. 产品经理的私房菜 - 腾讯产品模型 - 沟通能力篇

热门文章

  1. 内连接、外连接、全连接
  2. oracle 用户的登录,授权,传递授权操作
  3. OpenCV-Python 级联分类器训练 | 六十三
  4. Sallen-Key 有源滤波器(1)
  5. 浅谈共轭梯度法的原理
  6. 基于Arduino锂电池容量测试仪
  7. ASP.NET Core 基础(九)——路由Routing
  8. Python培训:python中写文件的操作方法
  9. Mendix POC 项目分享——系统需求说明书
  10. idea 远程debug调试