`
我想我是海
  • 浏览: 214498 次
社区版块
存档分类
最新评论

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') ;


 



分享到:
评论

相关推荐

    Sams Teach Yourself Hadoop in 24 Hours epub

    Sams Teach Yourself Hadoop in 24 Hours 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    Sam Teach Yourself jQuery Mobile In 24 Hours

    Sam Teach Yourself jQuery Mobile In 24 Hours

    SQL in 10 Minutes, Sams Teach Yourself (4th Edition)

    根据提供的文件信息,可以提取的知识点主要集中在书籍《SQL in 10 Minutes, Sams Teach Yourself (4th Edition)》的介绍和版权声明。这本书是为初学者准备的SQL学习资料,其第四版的PDF版本包含书签,对于想要学习...

    Sams Teach Yourself Unity 2018 Game Development in 24 Hours(3rd) 英文epub 第3版

    Sams Teach Yourself Unity 2018 Game Development in 24 Hours(3rd) 英文epub 第3版 pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系...

    Sams Teach Yourself Python Programming for Raspberry Pi in 24 Hours(2nd) 无水印pdf

    Sams Teach Yourself Python Programming for Raspberry Pi in 24 Hours(2nd) 英文无水印pdf 第2版 pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或...

    Sam's Teach Yourself Data Structures And Algorithms In 24 Hours

    ### Sam's Teach Yourself Data Structures and Algorithms in 24 Hours #### 一、书籍特色与目标读者 本书与其他数据结构和算法书籍的区别在于三个方面: 1. **易于理解:**作者的目标是让读者能够轻松掌握所...

    Sams Teach Yourself C++ in One Hour a Day 8th Edition

    《Sams Teach Yourself C++ in One Hour a Day》第八版是一本广受欢迎的C++学习教程,特别适合初学者入门。这本书以英文原版呈现,其中包含丰富的源代码示例,便于读者理解和实践编程概念。相比其他市面上的教程,...

    Teach Yourself Programming with Java in 24 Hours (Sams - 5th ed-2005)

    本电子书教会您在24小时学会Java的开发,介绍了编程的一些基本概念及Java的基础,也涵盖了最近Java开发的核心技术,这些核心的Java编程主题也已经有所拓展,此时也是Sams出版的21天内教会你Java的预先前提的书籍。

    sams teach yourself java

    标题《Sams Teach Yourself Java》和描述《Java》直接指向了本书的主题,即教授Java编程语言。这本书由Rogers Cadenhead和Laura Lemay撰写,旨在通过21天的教程帮助读者掌握Java编程的基础知识。 从提供的部分内容...

    Sam.s.Teach.Yourself.Visual.C++.In.12.Easy.Lesson_TEACH_sam teac

    《Sam's Teach Yourself Visual C++ In 12 Easy Lessons》是一本旨在帮助初学者逐步掌握Visual C++编程的教程。这本书以12个逐步进阶的课程为结构,旨在让学习者在轻松的环境中理解并实践C++编程语言,同时利用微软...

    Teach Yourself the C# Language in 21 Days

    Sams Teach Yourself the C# Language in 21 Days is the only book on the market that takes C# out of the Microsoft Visual Studio and teaches it as a platform-independent language—letting readers ...

    Sap - Sams Teach Yourself Abap 4 In 21 Days

    《Sap - Sams Teach Yourself ABAP 4 In 21 Days》是一本旨在帮助读者在21天内快速掌握ABAP(Advanced Business Application Programming)编程语言的教程。ABAP是SAP系统中的核心编程语言,用于开发企业级业务应用...

    强行拷贝sam数据库

    强行拷贝sam数据库

    交通安全SSAM软件

    《交通安全SSAM软件详解》 交通安全是社会公共安全的重要组成部分,而SSAM(交通安全分析软件)作为一款专业工具,为交通安全管理提供了强大的技术支持。本文将深入探讨SSAM软件的功能、应用以及与Vissim软件的协同...

    sam人事管理系统(图片按钮 数据库 控件 界面美化 sql)

    "Sam人事管理系统"是一款专为人事管理设计的应用程序,它结合了图片按钮、数据库操作、控件使用以及界面美化等多种技术,旨在提供一个直观且高效的人事信息管理平台。在这个系统中,开发者利用了SQL数据库进行数据...

    人事管理系统 sql数据库课程设计 vc++

    SQL数据库课程设计是指利用SQL语言来构建和管理数据库,这涉及到数据库的概念模型设计、逻辑模型设计、物理模型设计以及SQL查询语句的编写和优化。而“VC++”则是微软的Visual C++编程环境,常用于开发Windows平台的...

    new visual c++ in 21 days.pdf sam ebook.pdf

    《Sams Teach Yourself Visual C++ 6 in 21 Days》是戴维·查普曼(Davis Chapman)撰写的一本教程,旨在帮助读者在21天内掌握Microsoft的Visual C++ 6编程环境。这本书由麦克米伦计算机出版公司的一个部门——萨姆斯...

    SSAM交通冲突分析软件下载及详解

    【SSAM】交通冲突分析软件下载及详解

    JDBC连接MySQL例子

    本示例是关于如何使用JDBC连接MySQL数据库的一个实践教程,涵盖了数据库连接、数据操作以及大文本和图片的存储。 首先,我们需要了解JDBC的基本流程,包括加载驱动、建立连接、创建Statement或PreparedStatement...

Global site tag (gtag.js) - Google Analytics