关于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_6_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);
  • 相关文章

    数据库版本:11.2.0.4 RAC(1)问题现象从EM里面可以看到,在23号早上8:45~8:55时,数据库等待会话暴增...
    (一)问题背景最近在对一个大约200万行数据的表查看执行计划时,发现存在异常,理论上应该返回100多万...
    (一)删除备份--DELETE命令用于删除RMAN备份记录及相应的物理文件。当使用RMAN执行备份操作时,会在RM...
    (1)DRA介绍 数据恢复顾问(Data Recovery Advise)是一个诊断和修复数据库的工具,DRA能够修复数据文...
    RMAN(Recovery Manager)是Oracle恢复管理器的简称,是集数据库备份(backup)、修复(restore)和恢复...
    (1)备份对象 可以使用RMAN进行的备份对象如下: --整个数据库:备份所有的数据文件和控制文件; --数...