您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關Oracle數據庫中自帶的所有表結構是什么的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
CREATE TABLE "TEST"."TB_EMP" ( "EMPNO" NUMBER(4,0) PRIMARY KEY NOT NULL, "ENAME" VARCHAR2(10), "JOB" VARCHAR2(9), "MGR" NUMBER(4,0), "HIREDATE" DATE, "SAL" NUMBER(7,2), "COMM" NUMBER(7,2), "DEPTNO" NUMBER(2,0) ); COMMENT ON COLUMN "TEST"."TB_EMP"."EMPNO" IS '員工編號'; COMMENT ON COLUMN "TEST"."TB_EMP"."ENAME" IS '姓名'; COMMENT ON COLUMN "TEST"."TB_EMP"."JOB" IS '職位'; COMMENT ON COLUMN "TEST"."TB_EMP"."MGR" IS '領導編號'; COMMENT ON COLUMN "TEST"."TB_EMP"."HIREDATE" IS '入職時間'; COMMENT ON COLUMN "TEST"."TB_EMP"."SAL" IS '基本工資'; COMMENT ON COLUMN "TEST"."TB_EMP"."COMM" IS '獎金'; COMMENT ON COLUMN "TEST"."TB_EMP"."DEPTNO" IS '部門編號'; COMMENT ON TABLE "TEST"."TB_EMP" IS '員工表';
INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7369,'史密斯','店員',7902,TIMESTAMP '1980-12-17 00:00:00.000000',800,NULL,20); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7499,'艾倫','售貨員',7698,TIMESTAMP '1981-02-20 00:00:00.000000',1600,300,30); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7521,'沃德','售貨員',7698,TIMESTAMP '1981-02-22 00:00:00.000000',1250,500,30); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7566,'瓊斯','經理',7839,TIMESTAMP '1981-04-02 00:00:00.000000',2975,NULL,20); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7654,'馬丁','售貨員',7698,TIMESTAMP '1981-09-28 00:00:00.000000',1250,1400,30); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7698,'布萊克','經理',7839,TIMESTAMP '1981-05-01 00:00:00.000000',2850,NULL,30); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7782,'克拉克','經理',7839,TIMESTAMP '1981-06-09 00:00:00.000000',2450,NULL,10); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7788,'斯科特','分析師',7566,TIMESTAMP '1987-04-19 00:00:00.000000',3000,NULL,20); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7839,'國王','總統',NULL,TIMESTAMP '1981-11-17 00:00:00.000000',5000,NULL,10); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7844,'特納','售貨員',7698,TIMESTAMP '1981-09-08 00:00:00.000000',1500,0,30); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7876,'亞當斯','店員',7788,TIMESTAMP '1987-05-23 00:00:00.000000',1100,NULL,20); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7900,'詹姆斯','店員',7698,TIMESTAMP '1981-12-03 00:00:00.000000',950,NULL,30); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7902,'福特','分析師',7566,TIMESTAMP '1981-12-03 00:00:00.000000',3000,NULL,20); INSERT INTO "TB_EMP" (EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO) VALUES (7934,'米勒','店員',7782,TIMESTAMP '1982-01-23 00:00:00.000000',1300,NULL,10);
SELECT * FROM "TEST"."TB_EMP"
CREATE TABLE "TEST"."TB_DEPT" ( "DEPTNO" NUMBER(2,0) PRIMARY KEY NOT NULL, "DNAME" VARCHAR2(14), "LOC" VARCHAR2(13) ); COMMENT ON COLUMN "TEST"."TB_DEPT"."DEPTNO" IS '部門編號'; COMMENT ON COLUMN "TEST"."TB_DEPT"."DNAME" IS '部門名稱'; COMMENT ON COLUMN "TEST"."TB_DEPT"."LOC" IS '部門所在位置'; COMMENT ON TABLE "TEST"."TB_DEPT" IS '部門表';
INSERT INTO "TB_DEPT" (DEPTNO,DNAME,LOC) VALUES (10,'會計','紐約'); INSERT INTO "TB_DEPT" (DEPTNO,DNAME,LOC) VALUES (20,'研究','達拉斯'); INSERT INTO "TB_DEPT" (DEPTNO,DNAME,LOC) VALUES (30,'銷售','芝加哥'); INSERT INTO "TB_DEPT" (DEPTNO,DNAME,LOC) VALUES (40,'運營','波士頓');
SELECT * FROM "TEST"."TB_DEPT";
CREATE TABLE TEST."TB_BONUS" ( "ENAME" VARCHAR2(10), "JOB" VARCHAR2(9), "SAL" NUMBER, "COMM" NUMBER ); COMMENT ON COLUMN "TEST"."TB_BONUS"."ENAME" IS '姓名'; COMMENT ON COLUMN "TEST"."TB_BONUS"."JOB" IS '職位'; COMMENT ON COLUMN "TEST"."TB_BONUS"."SAL" IS '基本工資'; COMMENT ON COLUMN "TEST"."TB_BONUS"."COMM" IS '獎金'; COMMENT ON TABLE "TEST"."TB_BONUS" IS '獎金表';
空
CREATE TABLE "TEST"."TB_SALGRADE" ( "GRADE" NUMBER, "LOSAL" NUMBER, "HISAL" NUMBER ); COMMENT ON COLUMN "TEST"."TB_SALGRADE"."GRADE" IS '工資等級'; COMMENT ON COLUMN "TEST"."TB_SALGRADE"."LOSAL" IS '最低工資'; COMMENT ON COLUMN "TEST"."TB_SALGRADE"."HISAL" IS '最高工資'; COMMENT ON TABLE "TEST"."TB_SALGRADE" IS '工資等級表';
INSERT INTO TEST.TB_SALGRADE (GRADE,LOSAL,HISAL) VALUES (1,700,1200); INSERT INTO TEST.TB_SALGRADE (GRADE,LOSAL,HISAL) VALUES (2,1201,1400); INSERT INTO TEST.TB_SALGRADE (GRADE,LOSAL,HISAL) VALUES (3,1401,2000); INSERT INTO TEST.TB_SALGRADE (GRADE,LOSAL,HISAL) VALUES (4,2001,3000); INSERT INTO TEST.TB_SALGRADE (GRADE,LOSAL,HISAL) VALUES (5,3001,9999);
SELECT * FROM TEST.TB_SALGRADE;
CREATE TABLE "TEST"."TB_USERS" ( "ID" VARCHAR2(10) PRIMARY KEY NOT NULL, "USERNAME" VARCHAR2(64), "PASSWORD" VARCHAR2(64), "AGE" NUMBER(3,0), "SEX" VARCHAR2(1) ); COMMENT ON COLUMN "TEST"."TB_USERS"."ID" IS '用戶唯一id'; COMMENT ON COLUMN "TEST"."TB_USERS"."USERNAME" IS '用戶名'; COMMENT ON COLUMN "TEST"."TB_USERS"."PASSWORD" IS '密碼'; COMMENT ON COLUMN "TEST"."TB_USERS"."AGE" IS '年齡'; COMMENT ON COLUMN "TEST"."TB_USERS"."SEX" IS '性別'; COMMENT ON TABLE "TEST"."TB_USERS" IS '用戶表';
INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('1','史密斯','123456',23,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('2','艾倫','123456',18,'0'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('3','沃德','123456',28,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('4','瓊斯','123456',19,'0'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('5','馬丁','123456',25,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('6','布萊克','123456',27,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('7','克拉克','123456',29,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('8','斯科特','123456',32,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('9','國王','123456',90,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('10','特納','123456',52,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('11','亞當斯','123456',46,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('12','詹姆斯','123456',34,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('13','福特','123456',65,'1'); INSERT INTO "TB_USERS" (ID,USERNAME,PASSWORD,AGE,SEX) VALUES ('14','米勒','123456',75,'1');
select * from "TEST"."TB_USERS";
CREATE TABLE "UCLM"."TB_SALDETAIL" ( "SALNO" NUMBER(4,0) PRIMARY KEY NOT NULL, "ENAME" VARCHAR2(10), "SALYEAR" VARCHAR2(10), "SALMONTH" VARCHAR2(4), "SAL" NUMBER(7,2), "COMM" NUMBER(7,2), "EMPNO" NUMBER(4,0) ); COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."SALNO" IS '工資編號'; COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."ENAME" IS '姓名'; COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."SALYEAR" IS '發薪年份'; COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."SALMONTH" IS '發薪月份'; COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."SAL" IS '基本工資'; COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."COMM" IS '獎金'; COMMENT ON COLUMN "UCLM"."TB_SALDETAIL"."EMPNO" IS '員工編號'; COMMENT ON TABLE "UCLM"."TB_SALDETAIL" IS '工資詳細表';
INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(1, '史密斯', '2020', '01', 800, 0, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(2, '史密斯', '2020', '02', 801.14, 300, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(3, '史密斯', '2020', '03', 804.21, null, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(4, '史密斯', '2020', '04', 806.41, null, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(5, '史密斯', '2020', '05', 800.55, 100, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(6, '史密斯', '2020', '06', 806.14, 200, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(7, '史密斯', '2020', '07', 800.55, null, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(8, '史密斯', '2020', '08', 806.84, null, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(9, '史密斯', '2020', '09', 800.77, null, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(10, '史密斯', '2020', '10', 806.85, null, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(11, '史密斯', '2020', '11', 800.83, 0, 7369); INSERT INTO TEST.TB_SALDETAIL (SALNO, ENAME, SALYEAR, SALMONTH, SAL, COMM, EMPNO) VALUES(12, '史密斯', '2020', '12', 806.14, 100, 7369);
感謝各位的閱讀!關于“Oracle數據庫中自帶的所有表結構是什么”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。