--------------------------------------------------------
-- File created - 星期四-六月-28-2018
--------------------------------------------------------
DROP TABLE "SCOTT"."ASSISTANT" cascade constraints;
DROP TABLE "SCOTT"."SALES" cascade constraints;
DROP TABLE "SCOTT"."SCENIC" cascade constraints;
DROP TABLE "SCOTT"."SIGHT" cascade constraints;
DROP TABLE "SCOTT"."TICKET" cascade constraints;
DROP TABLE "SCOTT"."TOURIST" cascade constraints;
DROP TABLE "SCOTT"."TYPS" cascade constraints;
DROP TABLE "SCOTT"."USERS" cascade constraints;
DROP VIEW "SCOTT"."P_TICKET";
DROP VIEW "SCOTT"."SUM_PRICE";
DROP VIEW "SCOTT"."T_MESS";
DROP PROCEDURE "SCOTT"."PROCEDURE1";
DROP PROCEDURE "SCOTT"."PROCEDURE2";
DROP PROCEDURE "SCOTT"."PROCEDURE3";
DROP PROCEDURE "SCOTT"."STATISTIC_QT";
--------------------------------------------------------
-- DDL for Table SCENIC
--------------------------------------------------------
CREATE TABLE "SCOTT"."SCENIC"
( "VID" NUMBER(9,0),
"VNAME" CHAR(40 BYTE),
"VADD" CHAR(40 BYTE),
"SID" NUMBER(9,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table ASSISTANT
--------------------------------------------------------
CREATE TABLE "SCOTT"."ASSISTANT"
( "AID" NUMBER(9,0),
"ANAME" CHAR(20 BYTE),
"ASEX" CHAR(20 BYTE),
"AGE" NUMBER(*,0),
"ACELL" NUMBER(20,0),
"VID" NUMBER(9,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table TICKET
--------------------------------------------------------
CREATE TABLE "SCOTT"."TICKET"
( "KID" NUMBER(9,0),
"VID" NUMBER(9,0),
"TYID" NUMBER(10,0),
"PRICE" NUMBER(9,2),
"LNUM" NUMBER(*,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table TOURIST
--------------------------------------------------------
CREATE TABLE "SCOTT"."TOURIST"
( "TID" NUMBER(20,0),
"TNAME" VARCHAR2(15 BYTE),
"TSEX" VARCHAR2(15 BYTE),
"TPHONE" NUMBER(20,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table SIGHT
--------------------------------------------------------
CREATE TABLE "SCOTT"."SIGHT"
( "SID" NUMBER(9,0),
"SNAME" VARCHAR2(80 BYTE),
"SADD" VARCHAR2(40 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table TYPS
--------------------------------------------------------
CREATE TABLE "SCOTT"."TYPS"
( "TYID" NUMBER(10,0),
"TYNAME" VARCHAR2(15 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table SALES
--------------------------------------------------------
CREATE TABLE "SCOTT"."SALES"
( "TID" NUMBER(20,0),
"AID" NUMBER(9,0),
"KID" NUMBER(9,0),
"OUTID" NUMBER(9,0),
"SDATE" DATE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
--------------------------------------------------------
-- DDL for Table USERS
--------------------------------------------------------
CREATE TABLE "SCOTT"."USERS"
( "USERID" CHAR(20 BYTE),
"USERNAME" VARCHAR2(9 BYTE),
"USERPASSWORD" VARCHAR2(20 BYTE)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "USERS" ;
---------------------------------------------------
-- DATA FOR TABLE SCENIC
-- FILTER = none used
---------------------------------------------------
REM INSERTING into SCOTT.SCENIC
Insert into SCOTT.SCENIC (VID,VNAME,VADD,SID) values (1,'郑成功纪念馆 ','思明区鼓浪屿梳妆花园 ',1);
Insert into SCOTT.SCENIC (VID,VNAME,VADD,SID) values (2,'海底世界 ','思明区鼓浪屿海底世界 ',1);
Insert into SCOTT.SCENIC (VID,VNAME,VADD,SID) values (3,'菽庄花园 ','思明区鼓浪屿菽庄花园 ',1);
Insert into SCOTT.SCENIC (VID,VNAME,VADD,SID) values (4,'日光岩 ','思明区鼓浪屿日光岩 ',1);
Insert into SCOTT.SCENIC (VID,VNAME,VADD,SID) values (5,'福州路 ','思明区鼓浪屿福州路 ',1);
---------------------------------------------------
-- END DATA FOR TABLE SCENIC
---------------------------------------------------
---------------------------------------------------
-- DATA FOR TABLE TOURIST
-- FILTER = none used
---------------------------------------------------
REM INSERTING into SCOTT.TOURIST
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (111,'林新','female',1111);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (222,'林旧','female',2222);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (333,'蒋魏婷','female',3333);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (444,'蒋蜀婷','female',4444);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (555,'蒋吴婷','female',5555);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (666,'陈静','female',6666);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (777,'陈闹','female',7777);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (1510000001,'林新','female',11511);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (1510000002,'林旧','female',2235222);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (1510000003,'蒋魏婷','female',35352532333);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (1510000004,'蒋蜀婷','female',4444);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (1510000006,'陈静','female',6666);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (1510000007,'陈闹','female',7777);
Insert into SCOTT.TOURIST (TID,TNAME,TSEX,TPHONE) values (151000000