In oracle9i10g, if the database instance does not have the scott mode, you can manually create it as follows:
In oracle 9i/10g, if the database instance does not have the scott mode, you can manually create it as follows:
In Oracle 9i/10g, if the database instance does not have the scott mode, you can manually create it as follows:
Log on to the database
Create scott user
Assign permissions to scott users
Log On with scott user
1. Execute the following SQL statement
Drop table emp;
Drop table dept;
Drop table bonus;
Drop table salgrade;
Drop table dummy;
CREATE TABLE EMP
(Empno number (4) not null,
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 ', 'cler', 7902,
TO_DATE ('17-DEC-1980 ', 'dd-MON-YYYY'), 800, NULL, 20 );
INSERT INTO EMP VALUES
(7499, 'allen ', 'salesman', 7698,
TO_DATE ('20-FEB-1981 ', 'dd-MON-YYYY'), 1600,300, 30 );
INSERT INTO EMP VALUES
(7521, 'ward ', 'salesman', 7698,
TO_DATE ('22-FEB-1981 ', 'dd-MON-YYYY'), 1250,500, 30 );
INSERT INTO EMP VALUES
(7566, 'Jones ', 'manager', 7839,
TO_DATE ('2-APR-1981 ', 'dd-MON-YYYY'), 2975, NULL, 20 );
INSERT INTO EMP VALUES
(7654, 'martin ', 'salesman', 7698,
TO_DATE ('28-SEP-1981 ', 'dd-MON-YYYY'), 1250,140 0, 30 );
INSERT INTO EMP VALUES
(7698, 'bucke', 'manager', 7839,
TO_DATE ('1-MAY-1981 ', 'dd-MON-YYYY'), 2850, NULL, 30 );
INSERT INTO EMP VALUES
(7782, 'clark', 'manager', 7839,
TO_DATE ('9-JUN-1981 ', 'dd-MON-YYYY'), 2450, NULL, 10 );
INSERT INTO EMP VALUES
(7788, 'Scott ', 'analyst', 7566,
TO_DATE ('09-DEC-1982 ', 'dd-MON-YYYY'), 3000, NULL, 20 );
INSERT INTO EMP VALUES
(7839, 'King', 'President ', NULL,
TO_DATE ('17-NOV-1981 ', 'dd-MON-YYYY'), 5000, NULL, 10 );
INSERT INTO EMP VALUES
(7844, 'turner ', 'salesman', 7698,
TO_DATE ('8-SEP-1981 ', 'dd-MON-YYYY'), 1500, 0, 30 );
INSERT INTO EMP VALUES
(7876, 'adams', 'cler', 7788,
TO_DATE ('12-JAN-1983 ', 'dd-MON-YYYY'), 1100, NULL, 20 );
INSERT INTO EMP VALUES
(7900, 'James ', 'cler', 7698,
TO_DATE ('3-DEC-1981 ', 'dd-MON-YYYY'), 950, NULL, 30 );
INSERT INTO EMP VALUES
(7902, 'Ford ', 'analyst', 7566,
TO_DATE ('3-DEC-1981 ', 'dd-MON-YYYY'), 3000, NULL, 20 );
INSERT INTO EMP VALUES
(7934, 'miller ', 'cler', 7782,
TO_DATE ('23-JAN-1982 ', 'dd-MON-YYYY'), 1300, NULL, 10 );
CREATE TABLE DEPT
(Deptno number (2 ),
DNAME VARCHAR2 (14 ),
LOC VARCHAR2 (13 ));
Insert into dept values (10, 'accounting', 'New YORK ');
Insert into dept values (20, 'Research ', 'Dallas ');
Insert into dept values (30, 'sales', 'Chicago ');
Insert into dept values (40, 'operations', 'boston ');
CREATE TABLE BONUS
(ENAME VARCHAR2 (10 ),
JOB VARCHAR2 (9 ),
Sal number,
Comm number );
CREATE TABLE SALGRADE
(Grade number,
Losal number,
Hisal number );
Insert into salgrade values (1,700,120 0 );
Insert into salgrade values (2, 1201,140 0 );
Insert into salgrade values (3, 1401,200 0 );
Insert into salgrade values (4, 2001,300 0 );
Insert into salgrade values (5, 3001,999 9 );
CREATE TABLE DUMMY
(Dummy number );
Insert into dummy values (0 );
COMMIT;
In this way, the scott user and the classic tables under it are created successfully !!
For more information about Oracle, see the Oracle topic page? Tid = 12