摘要: ------------------------------------------------函数 begin---------------------------------22. 函数的 helloworld: 返回一个 "helloworld--!" 的字符串create or repla... 阅读全文
posted @ 2015-05-17 21:20 领导来根辣条 阅读(129) 评论(0) 推荐(0) 编辑
摘要: -----------------------------------oracle语法练习 begin-----------------------------------------0. 准备工作:set serveroutput onhellowrold 程序begindbms_output.... 阅读全文
posted @ 2015-05-17 20:48 领导来根辣条 阅读(251) 评论(0) 推荐(0) 编辑
摘要: -----------------------------游标 begin-----------------------------------------12. 使用游标要求: 打印出 80 部门的所有的员工的工资: salary: xxxdeclare --1. 定义游标 cursor s... 阅读全文
posted @ 2015-05-17 20:47 领导来根辣条 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 18. 异常的基本程序: 通过 select ... into ... 查询某人的工资, 若没有查询到, 则输出 "未找到数据"declare --定义一个变量 v_sal employees.salary%type;begin --使用 select ... into ... 为 v_sa... 阅读全文
posted @ 2015-05-17 14:45 领导来根辣条 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 57. 定义非空约束1). 非空约束只能定义在列级.2). 不指定约束名create table emp2 (name varchar2(30) not null, age number(3)); 3). 指定约束名 create table emp3(name varchar2(30) const... 阅读全文
posted @ 2015-05-17 14:24 领导来根辣条 阅读(192) 评论(0) 推荐(0) 编辑
摘要: --删除employee_id=113的记录delete from employees where employee_id=113;--保存回滚点,命名回滚点名称为emp113savepoint emp113; --删除employee_id=112的记录delete from employe... 阅读全文
posted @ 2015-05-17 13:45 领导来根辣条 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 55. 更改 108 员工的信息: 使其工资变为所在部门中的最高工资, job 变为公司中平均工资最低的 job1). 搭建骨架update employees set salary = (), job_id = () where employee_id = 108; 2). 所在部门中的最高工资... 阅读全文
posted @ 2015-05-17 13:28 领导来根辣条 阅读(1210) 评论(0) 推荐(0) 编辑
摘要: 51. 利用子查询创建表 myemp, 该表中包含 employees 表的 employee_id(id), last_name(name), salary(sal), email 字段1). 创建表的同时复制 employees 对应的记录create table myemp asselect... 阅读全文
posted @ 2015-05-17 13:09 领导来根辣条 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 40. 谁的工资比 Abel 高?1). 写两条 SQL 语句.SELECT salaryFROM employeesWHERE last_name = 'Abel' --返回值为 11000SELECT last_name, salaryFROM employeesWHERE salary > ... 阅读全文
posted @ 2015-05-17 00:37 领导来根辣条 阅读(258) 评论(0) 推荐(0) 编辑
摘要: ORACLE 测试一、完成下列SQL语句1.查询员工姓名(last_name或first_name),hire_date , department_id 满足以下条件:雇用时间在1997年之后,department_id 为80 或 90 或110, commission_pct不为空select... 阅读全文
posted @ 2015-05-16 20:04 领导来根辣条 阅读(399) 评论(0) 推荐(0) 编辑