分享
 
 
 

sam"s teach yourself Sql in 24hours的范例数据库表格Mysql版本。

王朝mssql·作者佚名  2006-12-17
窄屏简体版  字體: |||超大  

sam"s teach yourself Sql in 24hours的范例数据库表格Mysql版本。

sam"s teach yourself Sql in 24hours的范例数据库表格Mysql版本。 想找个范例的数据库原来真不是简单。呵呵

原书本上的数据库只是个标准,不是实现的版本。

在网上艰辛地找到了这个表格之后与发现自已用的Mysql字段的类型不符。

于是做了改动。下面的Sql文件可以直接导入Mysql了。

有了这个东东。可以节省很多输入的时间。学习更方便了。

--study.sql文件如下:

create datebase study;

use study

--表employee_tbl结构

create table employee_tbl

(emp_id varchar(9) not null,

last_name varchar(15) not null,

first_name varchar(15) not null,

middle_name varchar(15),

address varchar(30) not null,

city varchar(15) not null,

state char(2) not null,

zip numeric(5) not null,

phone char(10),

pager char(10),

constraint emp_pk primary key(emp_id) );

--表employee_pay_tbl结构

create table employee_pay_tbl

(emp_id varchar(9) not null,

position varchar(15) not null,

date_hire date,

pay_rate numeric(4,2),

date_last_raise date,

salary numeric(8,2),

bonus numeric(6,2),

constraint emp_fk foreign key(emp_id) references employee_tbl(emp_id) );

--表customer_tbl结构

create table customer_tbl

(cust_id varchar(10) not null primary key,

cust_name varchar(30) not null,

cust_address varchar(20) not null,

cust_city varchar(15) not null,

cust_state char(2) not null,

cust_zip numeric(5) not null,

cust_phone numeric(10),

cust_fax numeric(10) );

--表orders_tbl结构

create table orders_tbl

(ord_num varchar(10) not null primary key,

cust_id varchar(10) not null,

prod_id varchar(10) not null,

qty numeric(6) not null,

ord_date date );

--表products_tbl结构

create table products_tbl

(prod_id varchar(10) not null primary key,

prod_desc varchar(40) not null,

cost numeric(6,2) not null );

以下是各表的插入记录。

insert into employee_tbl values

('311549902','STEPHENS','TINA','DAWN','RR 3 BOX 17A','GREEN WOOD',

'IN','47890','3178784465',NULL) ;

insert into employee_tbl values

('442346889','PLEW','LINDA','CAROL','3301 REACON','INDIANAPO LIS',

'IN','46224','3172978990',NULL) ;

insert into employee_tbl values

('213764555','GLASS','BRANDON','SCOTT','1710 MAIN ST','WHITELAND',

'IN','47885','3178984321','3175709980') ;

insert into employee_tbl values

('313782439','GLASS','JACOB',NULL,'3789 WHITE RIVER BLVD',

'INDIANAPOLIS','IN','45734','3175457676','8887345678') ;

insert into employee_tbl values

('220984332','WALLACE','MARIAH',NULL,'7889 KEYSTONE AVE',

'INDIANAPOLIS','IN','48741','3173325986',NULL) ;

insert into employee_tbl values

('443679012','SPURGEON','TIFFANY',NULL,'5 GEORGE COURT',

'INDIANAPOLIS','IN','46234','317569007',NULL) ;

insert into employee_pay_tbl values

('311549902','MARKETING','1989-05-23',NULL,'1997-05-01','40000',NULL) ;

insert into employee_pay_tbl values

('442346889','TEAM LEADER','1990-06-17','14.75','1997-06-01',NULL,NULL) ;

insert into employee_pay_tbl values

('213764555','SALES MANAGER','1994-08-14',NULL,'1997-08-01','30000','2000') ;

insert into employee_pay_tbl values

('313782439','SALESMAN','1997-06-28',NULL,NULL,'20000','1000');

insert into employee_pay_tbl values

('220984332','SHIPPER','1996-07-22','11.00','1997-07-01',NULL,NULL) ;

insert into employee_pay_tbl values

('443679012','SHIPPER','1991-01-14','15.00','1997-01-01',NULL,NULL) ;

insert into customer_tbl values

('232','LESLTE GLEASON','798 HARDAWAY DR','INDIANAPOLIS',

'IN','47856','3175457690',NULL) ;

insert into customer_tbl values

('109','NANCY BUNKER','APT A 4556 WATERWAY','BROAD RIPPLE',

'IN','47950','3174262323',NULL) ;

insert into customer_tbl values

('345','ANGELA DOBKO','RR3 BOX 76','LEBANON','IN','49967',

'7858970090',NULL) ;

insert into customer_tbl values

('090','WENDY WOLF','3345 GATEWAY DR','INDIANAPOLIS','IN',

'46224','3172913421',NULL) ;

insert into customer_tbl values

('12','MARYS GIFT SHOP','435 MAIN ST','DANVILLE','IL','47978',

'3178567221','3178523434') ;

insert into customer_tbl values

('432','SCOTT MARKET','RR2 BDX 173','BROWNSBURG','IN',

'45687','3178529835','3178529836') ;

insert into customer_tbl values

('333','JASDNS AND DALLAS GOODIES','LAFAYETTE SQ MALL',

'INDIANAPOLIS','IN','46222','3172978886','3172978887') ;

insert into customer_tbl values

('21','MORGANS CANDIES AND TREATS','5657 W TENTH ST',

'INDIANAPOLIS','IN','46234','3172714398',NULL) ;

insert into customer_tbl values

('43','SCHYLERS NOVELTIES','17 MAPLE ST','LEBANON','IN',

'48990','3174346758',NULL) ;

insert into customer_tbl values

('288','HOLLYS GAMEARAMA','567 US 31 SOUTH','WHITELAND',

'IN','49980','3178879023',NULL) ;

insert into customer_tbl values

('287','GAVINS PLACE','9880ROCKVILLE RD','INDIANAPOLIS',

'IN','46244','3172719991','3172719992') ;

insert into customer_tbl values

('590','HEATHERS FEATHERS AND THINGS','4090 N SHADELAND AVE',

'INDIANAPOLIS','IN','43278','3175456768',NULL) ;

insert into customer_tbl values

('610','RAGANS HOBBIES INC','451 GREEN ST','PLAINFIELD','IN',

'46818','3178393441','3178399090') ;

insert into customer_tbl values

('560','ANDYS CANDIES','RR 1 BOX 34','NASHVILLE','IN',

'48756','8123239871',NULL) ;

insert into customer_tbl values

('221','RYANS STUFF','2337 S SHELBY ST','INDIANAPOLIS','IN',

'47834','3175634402',NULL) ;

insert into orders_tbl values

('56A901','232','11235','1','1997-10-22') ;

insert into orders_tbl values

('56A917','12','907','100','1997-09-30') ;

insert into orders_tbl values

('32A132','43','222','25','1997-10-10') ;

insert into orders_tbl values

('16C17','090','222','2','1997-10-17') ;

insert into orders_tbl values

('18D778','287','90','10','1997-10-17') ;

insert into orders_tbl values

('23E934','432','13','20','1997-10-15') ;

insert into products_tbl values

('11235','WITCHES COSTUME','29.99') ;

insert into products_tbl values

('222','PLASTIC PUMPKIN 18 INCH','7.75') ;

insert into products_tbl values

('13','FALSE PARAFFIN TEETH','1.10') ;

insert into products_tbl values

('90','LIGHTED LANTERNS','14.50') ;

insert into products_tbl values

('15','ASSORTED COSTUMES','10.00') ;

insert into products_tbl values

('9','CANDY CORN','1.35') ;

insert into products_tbl values

('6','PUMPKIN CANDY','1.45') ;

insert into products_tbl values

('87','PLASTIC SPIDERS','1.05') ;

insert into products_tbl values

('119','ASSORTED MASKS','4.95') ;

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有