关于Oracle数据库中的employee实例表

前端之家收集整理的这篇文章主要介绍了关于Oracle数据库中的employee实例表前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Oracle数据库安装的时候会自带一个练习用数据库(其中包含employee表,后来版本中此表改名为emp);

首先在安装过程中应该有个选项“是否安装实例表”(完全安装模式下默认是选择的),需要选择才有此表;
此表归属于scott账户,scott用户默认口令为tiger
如果发现scott账户已过期(Oracle 10g中经常发生),或口令不正确,可以通过以下方法进行设置

  1. --账户解锁
  2. alteruserscottaccountunlock;
  3. --重设scott账户口令为tiger
  4. userscottidentifiedbytiger;


附:实例表建表语句(适用于Oracle)
----------------------demobld.sqlbegin-----------------------
  • --
  • --Copyright(c)OracleCorporation1988,2000.AllRightsReserved.
  • --NAME
  • --demobld.sql
  • --DESCRIPTION
  • --Thisscript.createsthesql*Plusdemonstrationtablesinthe
  • --currentschema.ItshouldbeSTARTedbyeachuserwishingto
  • --accessthetables.Toremovethetablesusethedemodrop.sql
  • --script.
  • --USAGE
  • --Fromwithinsql*Plus,enter:
  • --STARTdemobld.sql
  • SETTERMOUTON
  • PROMPTBuildingdemonstrationtables.Pleasewait.
  • OFF
  • DROPTABLEEMP;
  • TABLEDEPT;
  • TABLEBONUS;
  • TABLESALGRADE;
  • TABLEDUMMY;
  • CREATETABLEEMP
  • (EMPNONUMBER(4)NOTNULL,
  • ENAMEVARCHAR2(10),250); line-height:18px"> JOBVARCHAR2(9),250); line-height:18px"> MGRNUMBER(4),250); line-height:18px"> HIREDATEDATE,250); line-height:18px"> SALNUMBER(7,2),250); line-height:18px"> COMMNUMBER(7,250); line-height:18px"> DEPTNONUMBER(2));
  • INSERTINTOEMPVALUES
  • (7369,'SMITH','CLERK',7902,250); line-height:18px"> TO_DATE('17-DEC-1980','DD-MON-YYYY'),800, (7499,'ALLEN','SALESMAN',7698,250); line-height:18px"> TO_DATE('20-FEB-1981',1600,300,30);
  • (7521,'WARD',250); line-height:18px"> TO_DATE('22-FEB-1981',1250,500,250); line-height:18px"> (7566,'JONES','MANAGER',7839,250); line-height:18px"> TO_DATE('2-APR-1981',2975,250); line-height:18px"> (7654,'MARTIN',250); line-height:18px"> TO_DATE('28-SEP-1981',1400,250); line-height:18px"> (7698,'BLAKE',250); line-height:18px"> TO_DATE('1-MAY-1981',2850,250); line-height:18px"> (7782,'CLARK',250); line-height:18px"> TO_DATE('9-JUN-1981',2450,10);
  • (7788,'SCOTT','ANALYST',7566,250); line-height:18px"> TO_DATE('09-DEC-1982',3000,250); line-height:18px"> (7839,'KING','PRESIDENT',250); line-height:18px"> TO_DATE('17-NOV-1981',5000,250); line-height:18px"> (7844,'TURNER',250); line-height:18px"> TO_DATE('8-SEP-1981',1500,250); line-height:18px"> (7876,'ADAMS',7788,250); line-height:18px"> TO_DATE('12-JAN-1983',1100,250); line-height:18px"> (7900,'JAMES',250); line-height:18px"> TO_DATE('3-DEC-1981',950,250); line-height:18px"> (7902,'FORD',250); line-height:18px"> (7934,'MILLER',7782,250); line-height:18px"> TO_DATE('23-JAN-1982',1300,85); font-weight:bold">TABLEDEPT
  • (DEPTNONUMBER(2),250); line-height:18px"> DNAMEVARCHAR2(14),250); line-height:18px"> LOCVARCHAR2(13));
  • INTODEPTVALUES(10,'ACCOUNTING','NEWYORK');
  • VALUES(20,'RESEARCH','DALLAS');
  • VALUES(30,'SALES','CHICAGO');
  • VALUES(40,'OPERATIONS','BOSTON');
  • TABLEBONUS
  • (ENAMEVARCHAR2(10),250); line-height:18px"> SALNUMBER,250); line-height:18px"> COMMNUMBER);
  • TABLESALGRADE
  • (GRADENUMBER,250); line-height:18px"> LOSALNUMBER,250); line-height:18px"> HISALNUMBER);
  • INTOSALGRADEVALUES(1,700,1200);
  • VALUES(2,1201,1400);
  • VALUES(3,1401,2000);
  • VALUES(4,2001,3000);
  • VALUES(5,3001,9999);
  • TABLEDUMMY
  • (DUMMYNUMBER);
  • INTODUMMYVALUES(0);
  • COMMIT;
  • PROMPTDemonstrationtablebuildiscomplete.
  • EXIT
  • -------------------demobld.sqlend-----------------------
  • @H_298_404@实例建表语句(适用于MysqL TABLEemployee;
  • TABLEdept;
  • TABLEbonus;
  • TABLEsalgrade;
  • TABLEdummy;
  • TABLEemployee
  • (
  • employeenoDECIMAL(4) enameVARCHAR(10),250); line-height:18px"> jobVARCHAR(9),250); line-height:18px"> mgrDECIMAL(4),250); line-height:18px"> hiredate salDECIMAL(7,250); line-height:18px"> comm deptnoDECIMAL(2)
  • );
  • INTOemployee'1980-12-17','1981-2-20','1981-2-22','1981-4-2','1981-9-28','1981-5-1','1981-7-9','1982-12-9','1981-11-17','1981-9-8','1983-1-12','1981-12-3','1982-1-23',85); font-weight:bold">TABLEdept
  • (deptnoDECIMAL(2),250); line-height:18px"> dnameVARCHAR(14),250); line-height:18px"> locVARCHAR(13));
  • INTOdeptTABLEbonus
  • (enameDECIMAL,85); font-weight:bold">DECIMAL);
  • TABLEsalgrade
  • (grade losal hisalINTOsalgradeTABLEdummy
  • (dummyINTOdummyVALUES(0);
  • 猜你在找的Oracle相关文章