1.Base基础/3.Icon图标/操作/search备份
1.Base基础/3.Icon图标/操作/search备份
EN
文档
关于AntDB
部署与升级
快速入门
运维
调优
工具和插件
高级服务
数据安全
参考
  • 文档首页 /
  • 使用教程 /
  • Oracle兼容 /
  • 示例参考表格

示例参考表格

更新时间:2024-07-01 14:39:46

emp 表:

CREATE TABLE emp (
	empno NUMBER(4),
	ename VARCHAR2(10),
	job VARCHAR2(9),
	mgr NUMBER(4),
	hiredate DATE,
	sal NUMBER(7,2),
	comm NUMBER(7,2),
	deptno NUMBER(2)
);

INSERT INTO emp VALUES (7369,'SMITH','CLERK',7902,'17-DEC-80',800,NULL,20);
INSERT INTO emp(empno,ename,job,mgr,hiredate,sal,comm,deptno) VALUES (7499,'ALLEN','SALESMAN',7698,'20-FEB-81',1600,300,30);
INSERT INTO emp(empno,ename,job,mgr,hiredate,sal,deptno) VALUES (7369,'SMITH','CLERK',7902,'17-DEC-80',800,20);

dept 表:

CREATE TABLE dept (
deptno	NUMBER(2) NOT NULL CONSTRAINT dept_pk PRIMARY KEY,
dname	VARCHAR2(14),
loc	VARCHAR2(13)
);
INSERT INTO dept (deptno, dname, loc)VALUES (50, 'HR', 'NEW YORK');
INSERT INTO dept (deptno, dname, loc)VALUES (20, ‘RESEARCH’, ‘DALLAS’);
INSERT INTO dept (deptno, dname, loc)VALUES (30, ‘SALES’, ‘CHICAGO’);
INSERT INTO dept (deptno, dname, loc)VALUES (40, ‘OPERATIONS’, ‘BOSTON’)

jobhist 表:

CREATE TABLE jobhist (
empno	NUMBER(4) NOT NULL,
startdate	DATE NOT NULL,
enddate	DATE,
job	VARCHAR2(9),
sal	NUMBER(7,2),
comm	NUMBER(7,2),
deptno	NUMBER(2),
chgdesc	VARCHAR2(80),
);
INSERT INTO jobhist VALUES (9001,'17-SEP-07',NULL,'CLERK',800,NULL,50,'New Hire');
INSERT INTO jobhist VALUES (9002,'20-SEP-07',NULL,'CLERK',700,NULL,50,'New Hire');
INSERT INTO jobhist VALUES (1001,'22-JUG-01',NULL,'MANAGER', 7000.00, NULL, 10, 'Promoted to manager');
INSERT INTO jobhist VALUES (1003, '19-OCT-01', NULL, ‘ANALYST’, 6000.00, NULL, 20, 'Joined as an analyst');
问题反馈