Oracle数据库安装的时候会自带一个练习用数据库(其中包含employee表,后来版本中此表改名为emp);
首先在安装过程中应该有个选项“是否安装实例表”(完全安装模式下默认是选择的),需要选择才有此表;
此表归属于scott账户,scott用户默认口令为tiger
如果发现scott账户已过期(Oracle 10g中经常发生),或口令不正确,可以通过以下方法进行设置
- --账户解锁
- alteruserscottaccountunlock;
- --重设scott账户口令为tiger
- 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;