插入数据 INSERT INSERT INTO myemp(ID,NAME,JOB,salary)VALUES(1001,'陈大文','扫地的',2000); INSERT INTO myemp(ID,NAME,JOB,salary)VALUES(1002,'陈小文','监督扫地',3000); INSERT INTO myemp(ID,NAME,JOB,salary)VALUES(1003,'陈中文','捡破烂',1000); 提交: COMMIT; 查看表格所有记录: select ...
1 1. 数据库原理1.1. 数据库简介1.1.1. 文件存储对数据的存储需求一直存在。保存数据的方式,经历了手工管理、文件管理等阶段,直至数据库管理阶段。文件存储方式保存数据的弊端:缺乏对数据的整体管理,数据不便修改;不利于数据分析和共享;数据量急剧增长,大量数据不可能长期保存在文件中。数据库应运而生,是人们...
INSERT INTO EMP (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) VALUES (3, '2', '3', 4, NULL, NULL, NULL, 10); 创建行级触发器checkSalaryTrigger,涨后工资这一列,确保大于涨前工资,语法:for each row/:new.sal/:old.sal 可以使用:new.sal/:old.sal来对比插入之前的值和插入之后...
Data Manipulation Language(DML) 用于对数据记录进行操作,包括插入,删除,修改。需要commit才能真正确认操作,如果需要撤销则rollback。 INSERT INTO:插入数据 INSERT INTO employee(id, name, salary) VALUES(1001, 'rose', 5500); UPDATE…SET..:更新数据 UPDATE employee SET salary = 8500 WHERE name = 'ROSE'...
Data Manipulation Language(DML) 用于对数据记录进行操作,包括插入,删除,修改。需要commit才能真正确认操作,如果需要撤销则rollback。 INSERT INTO:插入数据 INSERT INTO employee(id, name, salary) VALUES(1001, 'rose', 5500);UPDATE…SET..:更新数据 UPDATE employee SET salary = 8500 WHERE name = 'ROSE';...
set salary = 1.1 * salary where manager_id = id(i); 1. -- Slower method: for i in id.first..id.last loop update employees set salary = 1.1 * salary where manager_id = id(i); end loop; end; / 1.2.2 SELECT Statements that Reference Collections ...
'ANALYST', SAL * 1.1, 'CLERK', SAL * 1.15, 'MANAGER', SAL * 1.20, SAL ) REVISED_SALARY FROM employee; 函数的嵌套 单行函数可以嵌套到任何一个层次。其计算顺序为:先计算深层嵌套,再计算浅层嵌套。 embed.JPG 分组函数 什么是分组函数
创建行级触发器checkSalaryTrigger,涨后工资这一列,确保大于涨前工资,语法:for each row/:new.sal/:old.sal 可以使用:new.sal/:old.sal来对比插入之前的值和插入之后的值 CREATE OR REPLACE TRIGGER checkSalTrigger BEFORE UPDATE OF sal ON EMP
SELECT EMP_NAME , SALARY , GRADE FROM EMP WHERE EMP_NO = 342; SELECT EMP_NAME , SALARY , GRADE FROM EMP WHERE EMP_NO = 291; 方法2 (次低效) DECLARE CURSOR C1 (E_NO NUMBER) IS SELECT EMP_NAME,SALARY,GRADE FROM EMP WHERE EMP_NO = E_NO; ...
Compa-ratio (current workforce average and leavers average and new compa-ratio based on proposed salary during compensation planning) Compensation variance based on gender and performance rating Growth rate (standard earnings and supplemental earnings) High performer/medium performer/low performer salary cha...