Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

[Oracle] the following table structure, initialization data and table creation statements for scott users

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Table structure

EMP employee table

Serial number

Column name

Data type

Description

Constraint

one

EMPNO

NUMBER (4)

Employee number

Primary Key

two

ENAME

VARCHAR2 (10 BYTE)

Employee name

three

JOB

VARCHAR2 (9 BYTE)

Employee work

four

MGR

NUMBER (4)

Superior leader number

five

HIREDATE

DATE

Entry date

six

SAL

NUMBER (7 dint 2)

Employee's salary

seven

COMM

NUMBER (7 dint 2)

Employee bonus

eight

DEPTNO

NUMBER (2Jing 0)

Department number

Foreign Key

DEPT department table

Serial number

Column name

Data type

Description

Constraint

one

DEPTNO

NUMBER (2Jing 0)

Department number

Primary Key

two

DNAME

VARCHAR2 (14 BYTE)

Department name

three

LOC

VARCHAR2 (13 BYTE)

Department location

BONUS bonus list

Serial number

Column name

Data type

Description

Constraint

one

ENAME

VARCHAR2 (10 BYTE)

Employee name

two

JOB

VARCHAR2 (9 BYTE)

Employee work

three

SAL

NUMBER

Employee's salary

four

COMM

NUMBER

Employee bonus

SALGRADE salary scale

Serial number

Column name

Data type

Description

Constraint

one

GRADE

NUMBER

Wage grade

Primary Key

two

LOSAL

NUMBER

Minimum wage

three

HISAL

NUMBER

Maximum wage

Initialization data

EMP employee table

Serial number

EMPNO

ENAME

JOB

MGR

HIREDATE

SAL

COMM

DEPTNO

one

7369

SMITH

CLERK

7902

17-DEC-80

eight hundred

twenty

two

7499

ALLEN

SALESMAN

7698

20-FEB-81

1600

three hundred

thirty

three

7521

WARD

SALESMAN

7698

22-FEB-81

1250

five hundred

thirty

four

7566

JONES

MANAGER

7839

02-APR-81

2975

twenty

five

7654

MARTIN

SALESMAN

7698

28-SEP-81

1250

1400

thirty

six

7698

BLAKE

MANAGER

7839

01-MAY-81

2850

thirty

seven

7782

CLARK

MANAGER

7839

09-JUN-81

2450

ten

eight

7788

SCOTT

ANALYST

7566

19-APR-87

3000

twenty

nine

7839

KING

PRESIDENT

17-NOV-81

5000

ten

ten

7844

TURNER

SALESMAN

7698

08-SEP-81

1500

thirty

eleven

7876

ADAMS

CLERK

7788

23-MAY-87

1100

twenty

twelve

7900

JAMES

CLERK

7698

03-DEC-81

nine hundred and fifty

thirty

thirteen

7902

FORD

ANALYST

7566

03-DEC-81

3000

twenty

fourteen

7934

MILLER

CLERK

7782

23-JAN-82

1300

ten

DEPT department table

Serial number

DEPTNO

DNAME

LOC

one

ten

ACCOUNTING

NEW YORK

two

twenty

RESEARCH

DALLAS

three

thirty

SALES

CHICAGO

four

forty

OPERATIONS

BOSTON

BONUS bonus table [Note: there is no initial data in this table]

SALGRADE salary scale

Serial number

GRADE

LOSAL

HISAL

one

one

seven hundred

1200

two

two

1201

1400

three

three

1401

2000

four

four

2001

3000

five

five

3001

9999

Initialization statement

Look for the initialization script and find that the initialization script for scott users is? / rdbms/admin/utlsampl.sql

[oracle@prod admin] $grep-rn "CREATE TABLE SALGRADE" $ORACLE_HOME/u01/app/oracle/product/11.2.0/db_1/rdbms/admin/utlsampl.sql:92:CREATE TABLE SALGRADEgrep: / u01/app/oracle/product/11.2.0/db_1/bin/nmo: Permission deniedgrep: / u01/app/oracle/product/11.2.0/db_1/bin/nmhs: Permission deniedgrep: / u01/app/oracle/product/11.2.0/db_1/bin/nmb: Permission denied

Display the contents of the initialization script:

Rem Copyright (c) 1990, 2006, Oracle. All rights reserved. Rem NAMEREM UTLSAMPL.SQLRem FUNCTIONRem NOTESRem MODIFIEDRem lburgess 04Accord 02 Adding date formatsRem glumpkin 06-lowercase passwords Rem menash 02 Adding date formatsRem glumpkin 21 Adding date formatsRem glumpkin 01-remove unnecessary users for security reasonsRem gwood 03 Grey 23 99-make all dates Y2K compliantRem jbellemo 02 27 Adding date formatsRem glumpkin 97-dont connect as systemRem akolk 08 Grey 96-bug 368261: Adding date formatsRem glumpkin 10-21-92-Renamed from SQLBLD.SQL Rem blinden 07 Adding date formatsRem glumpkin 27 Adding date formatsRem glumpkin 92-Added Primary and foreign keys to EMP and DEPTRem rlim 04Accord 29Compact 91-change char to varchar2 Rem mmoore 04Compact 08Compact 91-use unlimited tablespace priv Rem pritto 04Placement 04Placement 91-change SYSDATE to 13-JUL-87 Rem Mendels 12-07-90-bug 30123 Add to_date calls so language independentRemrem rem $Header: utlsampl.sql 02-apr-2006.21:13:01 lburgess Exp $sqlbld.sql rem SET TERMOUT OFFSET ECHO OFF rem CONGDON Invoked in RDBMS at build time. 29-DEC-1988rem OATES: Created: 16-Feb-83 DROP USER SCOTT CASCADE;DROP USER ADAMS CASCADE;DROP USER JONES CASCADE;DROP USER CLARK CASCADE;DROP USER BLAKE CASCADE;GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY tiger;DROP PUBLIC SYNONYM PARTS; CONNECT SCOTT/tigerCREATE TABLE DEPT (DEPTNO NUMBER (2) CONSTRAINT PK_DEPT PRIMARY KEY,DNAME VARCHAR2 (14), LOC VARCHAR2 (13)) CREATE TABLE EMP (EMPNO NUMBER (4) CONSTRAINT PK_EMP PRIMARY KEY,ENAME VARCHAR2 (10), JOB VARCHAR2 (9), MGR NUMBER (4), HIREDATE DATE,SAL NUMBER (7Magne2), COMM NUMBER (7page2), DEPTNO NUMBER (2) CONSTRAINT FK_DEPTNO REFERENCES DEPT); INSERT INTO DEPT VALUES (10Med ACCOUNTING); INSERT INTO DEPT VALUES (20pas); INSERT INTO DEPT VALUES (30pas); INSERT INTO DEPT VALUES (40pas) INSERT INTO EMP VALUES (7369 parcels); INSERT INTO EMP VALUES (7902) (17-12-1980), 800 null 20); INSERT INTO EMP VALUES (7499), 7698 (20-2-1981), 1600, 300, 30); INSERT INTO EMP VALUES (7521, 721, WARDER, 768, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798, 798 and 798) INSERT INTO EMP VALUES (7566); INSERT INTO EMP VALUES (7698); INSERT INTO EMP VALUES (7698); (289-1981); INSERT INTO EMP VALUES (7698). INSERT INTO EMP VALUES (7788); 756, 756, and 756). INSERT INTO EMP VALUES (7839); INSERT INTO EMP VALUES (784)); INSERT INTO EMP VALUES (7698); (8-9-1981), 1500). INSERT INTO EMP VALUES (7876 parcels) 7788 memoir tokens date ('13murJULFULFULFULFULFEI 87 minutes,' dd-mm-rr')-51 mahjong 1100 NULLLWEI 20); INSERT INTO EMP VALUES (7900 parallels JAMSs memorials CLERKBEN m6698 memorials yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy INSERT INTO EMP VALUES (7902 MILLERRRKYY, 7902), 7566, 7566, 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 (1meme 700l200); INSERT INTO SALGRADE VALUES (2pje 1201jor1400); INSERT INTO SALGRADE VALUES (3rec 1401pr 2000); INSERT INTO SALGRADE VALUES (4meme 2001jor3000); INSERT INTO SALGRADE VALUES (5pr 3001je 9999); COMMIT;EXIT

Technical enthusiasts can perform destructive operations under scott users, etc., and then restore them with the help of initialization scripts.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report