Cyh的博客

Email:kissyan4916@163.com
posts - 26, comments - 19, trackbacks - 0, articles - 220

一个Oracle的小项目

Posted on 2009-02-16 19:34 啥都写点 阅读(645) 评论(0)  编辑  收藏 所属分类: DB

REM 以下是创建Toyz/Toyz用户方案的实现脚本

prompt ------------------------------------------------------------------------------------------

prompt 连接管理员用户

connect sys/sys as sysdba;

prompt 如果有Toyz用户则删除

drop user Toyz cascade;

prompt 创建用户Toyz

create user Toyz identified by Toyz;

prompt 向用户Toyz授予connect,resource角色权限

grant connect,resource to Toyz;

prompt 修改Toyzsystem中的表空间的配额 

alter user Toyz quota unlimited on system;

prompt 连接用户Toyz

connect Toyz/Toyz;

prompt ***************************************************************************************

prompt 以下是创建Toyz/Toyz用户表的实现脚本

prompt ***************************************************************************************

prompt 玩具表(Toys)

CREATE TABLE Toys

(

       cToyId char(6),

       vToyName varchar2(20),

       vToyDescription     varchar2(250),

       cCategoryId char(3),

       mToyPrice number(5,2),

       cBrandId char(3),

       siToyQty smallint,

       siLowerAge smallint,

       siUpperAge smallint,

       siToyWeight smallint,

       vToyImgPath varchar2(50)

);

prompt 玩具类别表(Category)

CREATE TABLE Category

(

       cCategoryId           char(3),

       cCategory              char(20),

       vDescription    varchar2(100)

);

prompt 包装表(Wrapper)

CREATE TABLE Wrapper

(

       cWrapperId    char(3),

       vDescription   varchar2(20),

       mWrapperPrice      number(5,2),

       vWrapperImgPath   varchar2(50)

);

prompt 玩具品牌表(ToyBrand)

CREATE TABLE ToyBrand

(

       cBrandId      char(3) ,

       cBrandName   char(20)

);

prompt 国家表(Country)

CREATE TABLE Country

(

       cCountryId     char(3) ,

       cCountry        char(25)

);

prompt 运输方式表(ShippingMode)

CREATE TABLE ShippingMode

(

       cModeId        char(2) ,

       cMode           char(25),

       iMaxDelDays int

);

prompt 运输价格表(ShippingRate)

CREATE TABLE ShippingRate

(

       cCountryID    char(3) ,

       cModeId               char(2),

       mRatePerPound     number(5,2) not null

);

prompt 购物车表(ShippingRate)

CREATE TABLE ShoppingCart

(

       cCartId  char(6),

       cToyId    char(6),

       siQty       smallint

);

prompt 购物者表(Shopper)

CREATE TABLE Shopper

(

       cShopperId    char(6),

       vFirstName    varchar2(20) ,

       vEmailId         varchar2(40) ,

       vAddress              varchar2(40) ,

       cState            char(15) ,

       cCountryId    char(3),

       cZipCode      char(10),

       cPhone          char(15),

       cCreditCardNo      char(16),

       vCreditCardType  varchar2(15),

       dExpiryDate  date

);

prompt 订单表(Orders)

CREATE TABLE Orders

(

       cOrderNo      char(6),

       dOrderDate    date,

       cCartId          char(6),

       cShopperId     char(6),

       cShippingModeId   char(2),

       mShippingCharges        number(5,2),

       mGiftWrapChargesnumber(5,2),

       cOrderProcessed    char(1),

       mTotalCost     number(8,2),

       dExpDelDate   Date

);

prompt 订单详情表(OrderDetail)

CREATE TABLE OrderDetail

(

       cOrderNo      char(6),

       cToyId          char(6),

       siQty             smallint,

       cGiftWrap      char(1),

       cWrapperId    char(3),

       vMessage              varchar2(256),

       mToyCost              number(8,2)

);

prompt 运输情况表(Shipment)

CREATE TABLE Shipment

(

       cOrderNo              char(6), 

       dShipmentDate              date,

       cDeliveryStatus             char(1),

       dActualDeliveryDate     date

);

prompt 接收者表(Recipient)

CREATE TABLE Recipient

(

       cOrderNo       char(6) ,

       vFirstName    varchar2(20),

       vAddress        varchar2(20),

       cCity             char(15),

       cState            char(15),

       cCountryId     char(3),

       cZipCode        char(10) ,

       cPhone           char(15)

);

prompt 月销售情况表(PickOfMonth)

CREATE TABLE PickOfMonth

(

       cToyId          char(6),

       siMonth          smallint,

       iYear              int,

       iTotalSold       int

);

prompt ***************************************************************************************

prompt 以下是创建Toyz/Toyz用户表数据的脚本

prompt ***************************************************************************************

prompt 对玩具表(Toys)插入数据

INSERT INTO   toys VALUES('000001','捕鲸','一个巨大的蓝鲸,带有两个手柄,可以让小孩骑在它的背上。','001', 8.99 ,'001',50,3,9,1,null);

INSERT INTO   toys VALUES('000002','水管道系统','小孩喜欢玩水。水管道系统有22块可互换的板片,这些板片可以组装一个带起重机、水轮和四搜船的码头,这只水轮产生水流。','001', 33.99,'001',60,5,9,2,null);

INSERT INTO   toys VALUES('000003','降落伞与火箭','站在发射台上发射火箭,随后一个降落伞从火箭上慢慢降落在地面上。 ','001', 6.99,'003',90,7,9,1,null);

INSERT INTO   toys VALUES('000004','大暴雨','用这个大暴雨装置可以在你们家花园里制造人工降雨。','001', 35.99,'005',74,8,9,1,null);

INSERT INTO   toys VALUES('000005','发光的展示灯','用一组彩色场景共同建立一个旋转的、能表示不同心情的情绪灯。','002', 15.99,'001',58,7,9,1,null);

INSERT INTO   toys VALUES('000006','玻璃装饰','?使你变得漂亮,象书上精美的图片一样。这一套包括八色的颜料,一个漆刷,样品和完整的使用说明书。','002', 12.99,'004',99,8,9,2,null);

INSERT INTO   toys VALUES('000007','tie dye kit?工具箱','检查原始的玩具列表','002', 19.99,'002',76,7,9,1,null);

INSERT INTO   toys VALUES('000008','爱丽丝奇境记','一本大的彩色书籍','002', 14.99,'001',82,4,8,1,null);

INSERT INTO   toys VALUES('000009','迷人的洋娃娃','穿着蓝棉布衣服和夹克的她,已经为试演做好拍摄准备。她有一个摄像机和红的大手提袋,以携带胶片传动装置。','002', 18.99,'001',39,6,9,2,null);

INSERT INTO   toys VALUES('000010','泡泡仙女娃娃','你的制作梦幻小女孩的梦想可以通过这套玩具成真。 你只需将魔棒蘸在有魔力的溶液里,然后按她脚上的按钮。紧接着,她就开始旋转,并吹出很多泡泡。这套玩具包括能产生泡沫的溶液,装溶液的盘,三个魔棒。这些魔棒能很容易地吸附在仙女娃娃的手腕上。','002',9.99,'002',78,4,8,1,null);

INSERT INTO   toys VALUES('000011','睡美人','让你的孩子用睡美人多尔扮演奇妙的神话故事。 ','002', 18.99,'005',65,4,8,1,null);

INSERT INTO   toys VALUES('000012','可爱的洋娃娃','漂亮的洋娃娃牵着小宠物。','002', 10.99,'001',82,4,8,1,null);

INSERT INTO   toys VALUES('000013','有漂亮头发的洋娃娃','小女孩们能改变这个洋娃娃头发的式样和颜色。','002', 14.99,'003',55,4,8,1,null);

INSERT INTO   toys VALUES('000015','爱花的洋娃娃','洋娃娃手上拿着一束花。','002', 49.99,'004',43,8,9,1,null);

INSERT INTO   toys VALUES('000016','维多利亚玩具房','这个漂亮的玩具房,会让每一个女孩子都喜欢它。', '002',43.25,'003',36,5,9,1,null);

INSERT INTO   toys VALUES('000017','厨房用具','一整套厨房用具,包括炉子和所有其他的厨房小用具。','006', 23.99,'002',76,5,9,2,null);

INSERT INTO   toys VALUES('000018','儿童卧室','儿童卧室放置着带梯子和壁橱的床铺。 ','006', 16.99,'005',15,5,9,2,null);

INSERT INTO   toys VALUES('000019','托儿所','这个托儿所有婴儿床和婴儿。','006', 8.99,'001',35,4,9,2,null);

INSERT INTO   toys VALUES('000020','维多利亚式家庭?','当你的小孩带着维多利亚式家庭去户外玩耍,它能让你的孩子按时回家。','006', 8.99,'001',45,4,9,2,null);

INSERT INTO   toys VALUES('000021','生日宴会','这个孩子们的聚会有玩魔术的魔术师,大游戏轮,树,各种形状和大小的气球,礼物和游戏。 ','006', 25.99,'004',56,4,9,1,null);

INSERT INTO   toys VALUES('000023','锡鼓','这个锡鼓适于邻里间表演,它附带有用于挂在身上的皮带和鼓槌。','012', 15.99,'001',88,3,8,1,null);

INSERT INTO   toys VALUES('000024','大音量的吉他','这个吉他有双重音量控制和放大电路,附带有护肩的衬垫和电池。','012', 25.99,'001',75,5,8,1,null);

INSERT INTO   toys VALUES('000025','我的第一个手电筒 ','本产品使得手电筒使用简单并有娱乐性。这个耐用的手电筒有一个大按钮方便开关。 需要一个AA电池(不包含在本产品之内)。','013', 7.99,'003',65,3,5,1,null);

INSERT INTO   toys VALUES('000026','电子保险箱','大尺寸的保险箱。只需按一个按钮就打开保险箱并听到警报声。把钱通过后面的秘密狭通道放入保险箱,并使用电子号码锁进行开启。','013', 22.99,'005',66,5,9,1,null);

INSERT INTO   toys VALUES('000027','X-90赛车套件','快速变化的赛车轨道是X-90赛车的最终挑战。套件还有带发动机的小汽车,这些小汽车的速度很快并可以做出刺激的赛车动作。','005', 19.99,'001',77,5,9,1,null);

INSERT INTO   toys VALUES('000028','沙丘接力赛','一套带有赛车道的沙丘童车。','005', 9.99,'004',78,4,9,1,null);

INSERT INTO   toys VALUES('000029','螺旋上升的道路','让孩子用这个易于组装的轨道,充分享受赛车的刺激和乐趣。','005', 14.99,'002',88,2,7,2,null);

INSERT INTO   toys VALUES('000030','卡车赛跑 ','可以用这个有超大轮胎的塑料卡车进行比赛。这个卡车很耐用','005', 35.99,'005',78,3,7,2,null);

INSERT INTO   toys VALUES('000031','大鸭子','这只大鸭子大而可爱,摸上去柔软。它用耐用的棉花制成,填充着可机洗的防火材料。','009', 17.99,'001',88,1,2,1,null);

INSERT INTO   toys VALUES('000032','婴儿明妮','你的孩子只要一接触明妮,她就发出嘎嘎的声音,像真的一样。 ','009', 14.99,'002',66,1,3,1,null);

COMMIT;

prompt 对玩具类别表(Category)插入数据

INSERT INTO     Category VALUES('001','活动性类','活动性玩具能培养孩子的社会技能并他们对周围的世界感兴趣。');

INSERT INTO     Category VALUES('002','洋娃娃类','广泛来自所有领先品牌的洋娃娃玩具');

INSERT INTO     Category VALUES('003','艺术与雕塑','鼓励孩子们用这些难以至信的雕塑工具箱去创造杰作');

INSERT INTO     Category VALUES('004','游戏','新的和经典游戏大全');

INSERT INTO     Category VALUES('005','汽车接力赛','所有当今汽车的模型');

INSERT INTO     Category VALUES('006','洋装玩耍','这些游戏对孩子的智力开发起着重要的作用');

INSERT INTO     Category VALUES('007','模型工具箱类','用于构造飞机、汽车、轮船等许多玩具的模型');

INSERT INTO     Category VALUES('008','婴儿类','为婴儿设计的彩色的、交互式玩具');

INSERT INTO     Category VALUES('009','塑料的玩具','熊、猴子以及许多软玩具');

INSERT INTO     Category VALUES('010','学习类','把玩具设计得如此有趣,以致孩子们忘了同时是在学习');

INSERT INTO     Category VALUES('011','科学与自然类','激发孩子探索周围世界的玩具');

INSERT INTO     Category VALUES('012','音乐玩具类','玩具可发出音乐、声音和歌曲');

INSERT INTO     Category VALUES('013','电动类','需用电池的电动玩具');

INSERT INTO     Category VALUES('014','木偶类','这些是木偶类玩具');

INSERT INTO    Category VALUES('015','火车类','这些火车是任何铁路系统的骄傲');

INSERT INTO     Category VALUES('016','建筑玩具类','鼓励孩子们建筑模型房和建筑物的砖、建筑材料和其他玩具');

COMMIT;

prompt 对包装表(Wrapper)插入数据

INSERT INTO Wrapper VALUES('001','壁虎',1,null);

INSERT INTO Wrapper VALUES('002','可爱',1.25,null);

INSERT INTO Wrapper VALUES('003','星星',1.50,null);

INSERT INTO Wrapper VALUES('004','气泡',2,null);

INSERT INTO Wrapper VALUES('005','芝麻街',1.5,null);

INSERT INTO Wrapper VALUES('006','月亮',2.25,null);

INSERT INTO Wrapper VALUES('007','海洋',1,null);

INSERT INTO Wrapper VALUES('008','天空',1,null);

COMMIT;

prompt 对玩具品牌表(ToyBrand)插入数据

INSERT INTO ToyBrand VALUES('001','机器猫');

INSERT INTO ToyBrand VALUES('002','蓝猫');

INSERT INTO ToyBrand VALUES('003','柏林小子');

INSERT INTO ToyBrand VALUES('004','西游记');

INSERT INTO ToyBrand VALUES('005','百雪公主');

INSERT INTO ToyBrand VALUES('006','疯狂世界');

INSERT INTO ToyBrand VALUES('007','蓝精灵');

INSERT INTO ToyBrand VALUES('008','三国演义');

COMMIT;

prompt 对国家表(Country)插入数据

INSERT INTO Country VALUES('001','美国');

INSERT INTO Country VALUES('002','阿尔巴利亚');

INSERT INTO Country VALUES('003','安道尔');

INSERT INTO Country VALUES('004','阿根廷');

INSERT INTO Country VALUES('005','澳大利亚');

INSERT INTO Country VALUES('006','孟加拉');

INSERT INTO Country VALUES('007','比利时');

INSERT INTO Country VALUES('008','波斯尼亚');

INSERT INTO Country VALUES('009','保加利亚');

INSERT INTO Country VALUES('010','捷克斯罗伐克');

INSERT INTO Country VALUES('011','丹麦');

INSERT INTO Country VALUES('012','南斯拉夫 ');

INSERT INTO Country VALUES('013','法国');

INSERT INTO Country VALUES('014','直布罗陀');

INSERT INTO Country VALUES('015','希腊');

INSERT INTO Country VALUES('016','格鲁吉亚');

INSERT INTO Country VALUES('017','克罗地亚');

INSERT INTO Country VALUES('018','爱沙尼亚');

INSERT INTO Country VALUES('019','冰岛');

INSERT INTO Country VALUES('020','意大利');

INSERT INTO Country VALUES('021','以色列');

INSERT INTO Country VALUES('022','印度');

INSERT INTO Country VALUES('023','塞浦路斯');

INSERT INTO Country VALUES('024','俄罗斯');

INSERT INTO Country VALUES('025','列支敦士登');

INSERT INTO  Country VALUES('027','立陶宛');

INSERT INTO Country VALUES('028','卢森堡');

INSERT INTO Country VALUES('030','马尔他');

INSERT INTO Country VALUES('031','Moldova');

INSERT INTO Country VALUES('032','摩纳哥');

INSERT INTO Country VALUES('033','荷兰');

INSERT INTO Country VALUES('034','挪威');

INSERT INTO Country VALUES('035','波兰');

INSERT INTO Country VALUES('036','葡萄牙');

INSERT INTO Country VALUES('037','罗马尼亚');

INSERT INTO Country VALUES('038','San Marino');

INSERT INTO Country VALUES('039','斯洛伐克共和国');

INSERT INTO Country VALUES('040','斯洛文尼亚');

INSERT INTO Country VALUES('041','芬兰');

INSERT INTO Country VALUES('042','葡萄牙');

INSERT INTO Country VALUES('043','瑞士');

INSERT INTO Country VALUES('044','土尔其');

INSERT INTO Country VALUES('045','乌克兰');

INSERT INTO Country VALUES('046','匈牙利');

INSERT INTO Country VALUES('047','德国');

INSERT INTO Country VALUES('048','瑞典');

INSERT INTO Country VALUES('049','拉托维亚');

COMMIT;

prompt 对运输方式表(ShippingMode)插入数据

INSERT INTO ShippingMode VALUES('01','标准航运',4);

INSERT INTO ShippingMode VALUES('02','国际邮件',3);

INSERT INTO ShippingMode VALUES('03','国际航运',1);

COMMIT;

prompt 对运输价格表(ShippingRate)插入数据

INSERT INTO ShippingRate VALUES('001','01',2);

INSERT INTO ShippingRate VALUES('001','02',4);

INSERT INTO ShippingRate VALUES('001','03',10);

INSERT INTO ShippingRate VALUES('002','01',03);

INSERT INTO ShippingRate VALUES('002','02',06);

INSERT INTO ShippingRate VALUES('002','03',10);

INSERT INTO ShippingRate VALUES('003','01',04);

INSERT INTO ShippingRate VALUES('003','02',06);

INSERT INTO ShippingRate VALUES('003','03',12);

INSERT INTO ShippingRate VALUES('004','01',04);

INSERT INTO ShippingRate VALUES('004','02',08);

INSERT INTO ShippingRate VALUES('004','03',12);

INSERT INTO ShippingRate VALUES('005','01',04);

INSERT INTO ShippingRate VALUES('005','02',08);

INSERT INTO ShippingRate VALUES('005','03',12);

INSERT INTO ShippingRate VALUES('006','01',04);

INSERT INTO ShippingRate VALUES('006','02',08);

INSERT INTO ShippingRate VALUES('006','03',12);

INSERT INTO ShippingRate VALUES('007','01',04);

INSERT INTO ShippingRate VALUES('007','02',06);

INSERT INTO ShippingRate VALUES('007','03',10);

INSERT INTO ShippingRate VALUES('008','01',04);

INSERT INTO ShippingRate VALUES('008','02',05);

INSERT INTO ShippingRate VALUES('008','03',08);

INSERT INTO ShippingRate VALUES('009','01',10);

INSERT INTO ShippingRate VALUES('009','02',12);

INSERT INTO ShippingRate VALUES('009','03',15);

INSERT INTO ShippingRate VALUES('010','01',10);

INSERT INTO ShippingRate VALUES('010','02',12);

INSERT INTO ShippingRate VALUES('010','03',15);

COMMIT;

prompt 对购物者表(Shopper)插入数据

INSERT INTO    Shopper VALUES('000001','史密斯','angelas@qmail.com','海滨大道227','弗吉尼亚州','001','22191','227-2344','6947343412896785','MASTER',to_date('08/09/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000002','拉尔森','barbaraj@speedmail.com','海滨大道227','加利福尼亚州','001','94087-1147','123-5673','5345146765854356','MASTER',to_date('04/10/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000003','威廉','bettyw@dpeedmil.cm','线索路1','弗吉尼亚州','001','23455','458-3299','4747343412896785','Visa',to_date('12/12/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000004','卡尔','carolj@qmail.com','765 - 莱卡大道 ','北卡罗莱纳州','001','28607','678-4544','6344676854335436','Visa Card',to_date('10/12/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000005','罗伯特','catheriner@qmail.com','5508 来克大街','加利福尼亚州','001','95123','445-2256','3756784562869963','MASTER',to_date('09/10/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000006','布朗','charlesb@speedmail.com','7822 S. 树荫大道 ','弗罗里达州','001','32751','225-6678','3454678545443344','Visa Card',to_date('10/09/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000007','戴维斯','Christopherd@qmail.com','4896 11th 大滨道 ','犹他州','001','84056-5410','556-9087','7899887675443322','Visa Card',to_date('10/02/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000008','米勒','cynthiam@qmailcom','98066 华尔大道','加利福尼亚州','001','93021-2930','422-5688','2345566576879900','MASTER',to_date('08/09/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000009','丹尼尔','danielw@speedmail.com','4642 人民大街 ','俄亥俄州','001','44141','454-2246','2345467890986745','Visa Card',to_date('11/02/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000010','摩尔','davidm@qmail.com','8808 快乐大道   ','加利福尼亚州','001','94583','982-5577','2343556678799674','Visa Card',to_date('11/12/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000011','泰勒','deboraht@qmail.com','2199- 真理大道','明尼苏达州','001','60048','889-2235','2345468798078563','MASTER',to_date('11/23/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000012','安得森','Donnaa@speedmail.com ','7930 奥良大道. ','内华达州','001','89117','845-2323','2314345676568766','Visa Card',to_date('11/24/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000013','托马斯','dorthyt@speedmail.com','678 东道 56 正明大道- #12','纽约州','001','10009','696-2278','8765435456678754','Visa Card',to_date('12/03/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000014','杰克逊','elizabethj@qmail.com','598 顶点街 #2','明尼苏达州','001','55102','545-9078','4576544354567542','Visa Card',to_date('10/06/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000015','特拉','francest@speedmail.com','2562 东道 ','德克萨斯州','001','76205-5922','878-6670','5676879007565452','Master Card',to_date('08/30/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000016','海伦','helenw@spedmail.com',null,'宾夕凡尼亚州','001','18950 ','585-7796','4564564564564565','Visa Card',to_date('10/10/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000017','瞻姆斯',' helenw@spedmail.com',Null,'弗吉尼亚州','001','22303-2541','335-6678','4657567545344544','Master Card',to_date('10/31/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000018','马丁','jenniferm@qmail.com',null,'马里兰州','001','21225','569-7789','9775445343233443','Visa Card',to_date('09/01/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000019','汤普森','jessicat@speedmail.com','565 圣石大道. ','德克萨斯州','001','76014','445-6797','9766545343233455','Master Card',to_date('09/19/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000020','约翰逊','johng@qmail.com','2234 B 国王大道','宾夕凡尼亚州','001','17109','521-9095','8764554334534567','Master Card',to_date('09/13/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000021','爱德华','josephm@qmail.com','995 福尼大道','加利福尼亚州','001','92354','456-9032','5687567567435344','Visa Card',to_date('05/31/2001','mm/dd/yyyy'));

INSERT INTO   Shopper VALUES('000022','飞利普','joycep@speedmail.com','535 达尔文街 ','宾夕凡尼亚州','001','15017','789-6905','2345345345645656','Master Card',to_date('09/15/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000023','鲁滨逊','karenr@qmail.com','2343-A 花道    ','乔治亚州','001','30067','334-5568','4546575675687689','Visa Card',to_date('02/26/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000024','克拉克','kimberlyc@speedmail.com','79 英雄大道 ','阿肯阿州','001','72204','645-9023','2345653757898999','Master Card',to_date('05/31/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000025','劳拉','laurar@speedmail.com',Null,'乔治亚州','001','30062','567-3345','2345345676786543','Visa Card',to_date('03/03/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000026','刘易斯','lindal@qmail.com','1524 巴塔尼亚大道 ','德克萨斯州','001','75075','459-4563','8765434523543366','Visa Card',to_date('03/14/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000027','琳莎','lisal@speedmail.com','18927 沙岩街 ','华圣顿州','001','98133','897-3345','7653534745756567','Master Card',to_date('08/30/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000028','汤姆','margaretw@speedmail.com','405 亚丁道#101 ','华圣顿州','001','99163','567-9083','9867865434534467','Master Card',to_date('07/09/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000029','玛利娅','Mariah@speedmail.com','936 德尔','纽约州','001','14609','345-8764','9786434564564567','Visa Card',to_date('04/06/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000030','玛丽','marya@qmail.com','1202 总统大街','明尼苏达州','001','61801-5304','749-3096','8674564574574356','Master Card',to_date('04/23/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000031','米切尔','michaely@speedmail.com',Null ,'阿拉巴马州','001','36117','560-9004','3478786786785677','Master Card',to_date('02/21/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000032','米切尔','michelleh@speedmail.com','1353 国王街','明尼苏达州','001','60563','294-5385','6965753564534554','Visa Card',to_date('01/02/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000033','南希','nancyk@qmail.com','429 华林大道 ','马萨州','001','01845','563-2298','3464276587468846','Master Card',to_date('01/01/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000034','布什','patreciaw@speedmail.com',Null,'加利福尼亚州','001','94517-1440','345-8765','3743567985785344','Master Card',to_date('02/21/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000035','克灵顿','paull@qmail.com','79 英雄大道 ','加利福尼亚州','001','91401','912-7905','4436465768677778','Master Card',to_date('03/03/2000','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000036','希尔','richardh@speedmail.com','405 亚丁道#101 ','加利福尼亚州','001','60022','459-8749','9568765745645666','Visa Card',to_date('10/06/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000037','罗伯特','Roberts@speedmail.com','405 亚丁道#101 ','加利福尼亚州','001','94618','709-5565','8678457546556555','Master Card',to_date('10/02/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000038','露丝','ruthg@speedmail.com','459 桥道','新泽西','001','07945','347-9082','9887654445423443','Visa Card',to_date('12/02/2001','mm/dd/yyyy'));

INSERT INTO    Shopper VALUES('000039','亚当斯','Sandra@qmail.com','1524 巴塔尼亚大道 ','弗罗里达州','001','32824','982-9503','7455463534636555','Master Card',to_date('04/18/2000','mm/dd/yyyy'));

COMMIT;

prompt 对接受者表(Recipient)插入数据

INSERT INTO    Recipient VALUES('000001','约翰逊','227 海滨大道.','桑德兰','加利福尼亚州','001','94087-1147','123-5673');

INSERT INTO    Recipient VALUES('000002','罗伯特','5508 国王大道','圣何塞','加利福尼亚州','001','95233-4123','445-2256');

INSERT INTO    Recipient VALUES('000003','戴维斯','4896 卡路乐大道','圣城','犹他州','001','84056-5410','556-9087');

INSERT INTO    Recipient VALUES('000005','约翰逊','227 海岛屿道.','桑德兰','加利福尼亚州','001','94087-1147','123-5673');

INSERT INTO    Recipient VALUES('000006','安得森','7930奥尔街.','拉斯韦加期','内华达州','001','89328-2517','845-2323');

INSERT INTO    Recipient VALUES('000009','摩尔','8808 快乐道','雷劳','加利福尼亚州','001','94453-5849','982-5577');

INSERT INTO    Recipient VALUES('000010','威廉姆','1 步行街','弗吉尼亚','弗吉尼亚州','001','23455-2456','458-3299');

INSERT INTO    Recipient VALUES('000004','马丁','9812 76th 正道','Brooklyn','马里兰州','001','21254-0025','569-7789');

INSERT INTO    Recipient VALUES('000007','劳拉','3242 达尔文 ','治亚','乔治亚州','001','30062-5423','567-3345');

INSERT INTO    Recipient VALUES('000008','米切尔','1353 域湖大道','内珀维尔','明尼苏达州','001','60563-1256','294-5385');

COMMIT;

prompt 对购物车表(ShoppingCart)插入数据

INSERT INTO ShoppingCart VALUES('000001','000001',1);

INSERT INTO ShoppingCart VALUES('000001','000007',1);

INSERT INTO ShoppingCart VALUES('000001','000008',1);

INSERT INTO ShoppingCart VALUES('000002','000016',1);

INSERT INTO ShoppingCart VALUES('000002','000009',1);

INSERT INTO ShoppingCart VALUES('000003','000017',1);

INSERT INTO ShoppingCart VALUES('000004','000030',1);

INSERT INTO ShoppingCart VALUES('000004','000004',1);

INSERT INTO ShoppingCart VALUES('000005','000001',1);

INSERT INTO ShoppingCart VALUES('000005','000024',1);

INSERT INTO ShoppingCart VALUES('000005','000030',1);

INSERT INTO ShoppingCart VALUES('000005','000018',1);

INSERT INTO ShoppingCart VALUES('000006','000017',1);

INSERT INTO ShoppingCart VALUES('000006','000013',1);

INSERT INTO ShoppingCart VALUES('000007','000006',1);

INSERT INTO ShoppingCart VALUES('000008','000023',1);

INSERT INTO ShoppingCart VALUES('000009','000018',1);

COMMIT;

prompt 对订单表(Orders)插入数据

INSERT INTO Orders VALUES('000001',to_date('05/20/2001','mm/dd/yyyy') ,'000002','000002','01',6,1.2500,'Y',62.2200,to_date('05/24/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000002',to_date('05/20/2001','mm/dd/yyyy') ,'000001','000005','02',8,2.0000,'Y',96.5000,to_date('05/23/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000003',to_date('05/20/2001','mm/dd/yyyy') ,'000003','000007','01',12,0,'Y',83.9700,to_date('05/24/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000004',to_date('05/20/2001','mm/dd/yyyy') ,'000004','000006','01',4,1.0000,'Y',40.9900,to_date('05/24/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000005',to_date('05/21/2001','mm/dd/yyyy') ,'000005','000002','03',90,7.7500,'Y',231.6800,to_date('05/25/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000006',to_date('05/21/2001','mm/dd/yyyy') ,'000003','000012','03',40,4.0000,'Y',97.9700,to_date('05/22/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000007',to_date('05/22/2001','mm/dd/yyyy') ,'000002','000008','01',4,0,'Y',16.9900,to_date('05/26/2001','mm/dd/yyyy') );

INSERT INTO Orders VALUES('000008',to_date('05/22/2001','mm/dd/yyyy') ,'000002','000009','03',20,2.0000,'Y',53.9800,to_date('05/26/2001','mm/dd/yyyy') );

INSERT INTO    Orders VALUES('000009',to_date('05/22/2001','mm/dd/yyyy') ,'000004','000010','02',8,2.000,'Y',26.9900,to_date('05/25/2001','mm/dd/yyyy') );

INSERT INTO    Orders VALUES('000010',to_date('05/22/2001','mm/dd/yyyy') ,'000005','000003','02',20,4.0000,'Y',67.9700,to_date('05/26/2001','mm/dd/yyyy') );

COMMIT;

prompt 对订单详情表(OrderDetail)插入数据

INSERT INTO    OrderDetail VALUES('000001','000007',2,'N',NULL,NULL,39.9800);

INSERT INTO    OrderDetail VALUES('000001','000008',1,'Y','002','生日快乐',14.9900);

INSERT INTO    OrderDetail VALUES('000002','000016',2,'Y','001','我爱你',86.5000);

INSERT INTO    OrderDetail VALUES('000003','000017',3,'N',NULL,NULL,71.9700);

INSERT INTO    OrderDetail VALUES('000004','000030',1,'Y','001','我爱你',35.9900);

INSERT INTO    OrderDetail VALUES('000005','000001',4,'Y','001','生日快乐',35.9600);

INSERT INTO    OrderDetail VALUES('000005','000024',1,'Y','002','最好的祝福',25.9900);

INSERT INTO    OrderDetail VALUES('000005','000030',2,'Y','002','生日快乐',71.9800);

INSERT INTO    OrderDetail VALUES('000006','000017',1,'Y','001','具有爱',29.9800);

INSERT INTO    OrderDetail VALUES('000006','000013',2,'Y','003','生日快乐',23.9900);

INSERT INTO    OrderDetail VALUES('000007','000006',1,'N',NULL,NULL,12.9900);

INSERT INTO    OrderDetail VALUES('000008','000023',2,'Y','001','为你带来爱',31.9800);

INSERT INTO    OrderDetail VALUES('000009','000018',1,'Y','004','祝贺',16.9900);

INSERT INTO    OrderDetail VALUES('000010','000020',2,'Y','005','你最棒',17.9800);

INSERT INTO    OrderDetail VALUES('000010','000021',1,'Y','001','生日快乐',25.9900);

COMMIT;

prompt 对运输情况表(Shipment)插入数据

INSERT INTO    Shipment VALUES('000001',to_date('05/23/2001','mm/dd/yyyy') ,'d',to_date('05/24/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000002',to_date('05/23/2001','mm/dd/yyyy') ,'d',to_date('05/23/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000003',to_date('05/23/2001','mm/dd/yyyy') ,'s',null);

INSERT INTO    Shipment VALUES('000004',to_date('05/24/2001','mm/dd/yyyy') ,'d',to_date('05/26/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000005',to_date('05/24/2001','mm/dd/yyyy') ,'d',to_date('05/25/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000006',to_date('05/22/2001','mm/dd/yyyy') ,'d',to_date('05/23/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000007',to_date('05/25/2001','mm/dd/yyyy') ,'s',null);

INSERT INTO    Shipment VALUES('000008',to_date('05/24/2001','mm/dd/yyyy') ,'d',to_date('05/24/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000009',to_date('05/24/2001','mm/dd/yyyy') ,'d',to_date('05/25/2001','mm/dd/yyyy') );

INSERT INTO    Shipment VALUES('000010',to_date('05/26/2001','mm/dd/yyyy') ,'d',to_date('05/28/2001','mm/dd/yyyy') );

COMMIT;

prompt 对月销售情况表(pickofmonth)插入数据

INSERT INTO    pickofmonth

VALUES('000001',1,2000,1000);

INSERT INTO    pickofmonth

VALUES('000001',2,2000,1230);

INSERT INTO    pickofmonth

VALUES('000005',3,2000,4000);

INSERT INTO    pickofmonth

VALUES('000007',4,2000,5000);

INSERT INTO    pickofmonth

VALUES('000003',5,2000,2000);

INSERT INTO    pickofmonth

VALUES('000002',6,2000,3000);

INSERT INTO    pickofmonth

VALUES('000003',7,2000,5670);

INSERT INTO    pickofmonth

VALUES('000007',8,2000,2340);

INSERT INTO    pickofmonth

VALUES('000011',9,2000,5600);

INSERT INTO    pickofmonth

VALUES('000020',10,2000,2300);

INSERT INTO    pickofmonth

VALUES('000021',11,2000,4500);

INSERT INTO    pickofmonth

VALUES('000026',12,2000,6500);

INSERT INTO    pickofmonth

VALUES('000024',1,2001,3200);

INSERT INTO    pickofmonth

VALUES('000015',2,2001,3100);

INSERT INTO    pickofmonth

VALUES('000012',3,2001,2500);

COMMIT;



                                                                                                       --    学海无涯
        


只有注册用户登录后才能发表评论。


网站导航: