摘要:
declare --定义游标, 因为需要对游标定义的数据进行修改操作, 所以添加了 for update 子句 cursor sal_cursor(dept_id number) is select salary sal from employees where dep... 阅读全文
摘要:
------------------------------------------------触发器 begin---------------------------------29. 触发器的 helloworld: 编写一个触发器, 在向 emp 表中插入记录时, 打印 'helloworl... 阅读全文
摘要:
------------------------------------------------存储过程 begin---------------------------------27. 定义一个存储过程: 获取给定部门的工资总和(通过 out 参数), 要求, 部门号和工资总额定义为参数cre... 阅读全文
摘要:
------------------------------------------------函数 begin---------------------------------22. 函数的 helloworld: 返回一个 "helloworld--!" 的字符串create or repla... 阅读全文
摘要:
-----------------------------------oracle语法练习 begin-----------------------------------------0. 准备工作:set serveroutput onhellowrold 程序begindbms_output.... 阅读全文
摘要:
-----------------------------游标 begin-----------------------------------------12. 使用游标要求: 打印出 80 部门的所有的员工的工资: salary: xxxdeclare --1. 定义游标 cursor s... 阅读全文
摘要:
18. 异常的基本程序: 通过 select ... into ... 查询某人的工资, 若没有查询到, 则输出 "未找到数据"declare --定义一个变量 v_sal employees.salary%type;begin --使用 select ... into ... 为 v_sa... 阅读全文
摘要:
57. 定义非空约束1). 非空约束只能定义在列级.2). 不指定约束名create table emp2 (name varchar2(30) not null, age number(3)); 3). 指定约束名 create table emp3(name varchar2(30) const... 阅读全文
摘要:
--删除employee_id=113的记录delete from employees where employee_id=113;--保存回滚点,命名回滚点名称为emp113savepoint emp113; --删除employee_id=112的记录delete from employe... 阅读全文
摘要:
55. 更改 108 员工的信息: 使其工资变为所在部门中的最高工资, job 变为公司中平均工资最低的 job1). 搭建骨架update employees set salary = (), job_id = () where employee_id = 108; 2). 所在部门中的最高工资... 阅读全文
摘要:
51. 利用子查询创建表 myemp, 该表中包含 employees 表的 employee_id(id), last_name(name), salary(sal), email 字段1). 创建表的同时复制 employees 对应的记录create table myemp asselect... 阅读全文
摘要:
40. 谁的工资比 Abel 高?1). 写两条 SQL 语句.SELECT salaryFROM employeesWHERE last_name = 'Abel' --返回值为 11000SELECT last_name, salaryFROM employeesWHERE salary > ... 阅读全文