数据库课程设计再续

php中文网
发布: 2016-06-07 16:13:00
原创
1458人浏览过

“茶咖啡”咖啡销售管理系统,新增了 一张表bill2,用于解决一个用户对应于多个商品的问题,不过写完之后发现多了几项冗余项,还在继续完善。。。。 代码如下: /****** Object: Table [dbo].[Member] Script Date: 12/26/2014 17:54:54 ******/SET ANSI_NULLS

“茶咖啡”咖啡销售管理系统,新增了 一张表bill2,用于解决一个用户对应于多个商品的问题,不过写完之后发现多了几项冗余项,还在继续完善。。。。

代码如下:

/****** Object:  Table [dbo].[Member]    Script Date: 12/26/2014 17:54:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Member](
	[MemberID] [char](11) NOT NULL,
	[MemberNAme] [char](10) NOT NULL,
	[MemberSex] [char](2) NOT NULL,
	[Memberphone] [varchar](12) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[MemberID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[Member] ([MemberID], [MemberNAme], [MemberSex], [Memberphone]) VALUES (N'2000010101 ', N'李一      ', N'男', N'15670276163')
INSERT [dbo].[Member] ([MemberID], [MemberNAme], [MemberSex], [Memberphone]) VALUES (N'2000010202 ', N'李二      ', N'女', N'15670276162')
/****** Object:  Table [dbo].[Goods]    Script Date: 12/26/2014 17:54:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Goods](
	[Goods_num] [char](4) NOT NULL,
	[Goods_name] [char](10) NULL,
	[Goods_danjia] [char](10) NULL,
	[Goods_left] [int] NULL,
PRIMARY KEY CLUSTERED 
(
	[Goods_num] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[Goods] ([Goods_num], [Goods_name], [Goods_danjia], [Goods_left]) VALUES (N'1   ', N'蓝山      ', N'20        ', 10)
INSERT [dbo].[Goods] ([Goods_num], [Goods_name], [Goods_danjia], [Goods_left]) VALUES (N'2   ', N'卡布奇诺  ', N'25        ', 10)
INSERT [dbo].[Goods] ([Goods_num], [Goods_name], [Goods_danjia], [Goods_left]) VALUES (N'3   ', N'拿铁      ', N'30        ', 10)
/****** Object:  Table [dbo].[BILL]    Script Date: 12/26/2014 17:54:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[BILL](
	[BILL_num] [char](10) NOT NULL,
	[BILL_time] [char](8) NOT NULL,
	[BILL_paymoney] [money] NOT NULL,
	[MemberID] [char](11) NULL,
PRIMARY KEY CLUSTERED 
(
	[BILL_num] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
INSERT [dbo].[BILL] ([BILL_num], [BILL_time], [BILL_paymoney], [MemberID]) VALUES (N'2010010101', N'20100101', 100.0000, N'2000010101 ')
INSERT [dbo].[BILL] ([BILL_num], [BILL_time], [BILL_paymoney], [MemberID]) VALUES (N'2010010102', N'20000102', 200.0000, N'2000010202 ')
/****** Object:  Table [dbo].[Customers]    Script Date: 12/26/2014 17:54:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Customers](
	[Customers_num] [char](10) NOT NULL,
	[BILL_num] [char](10) NOT NULL,
PRIMARY KEY CLUSTERED 
(
	[Customers_num] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[bill2]    Script Date: 12/26/2014 17:54:54 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[bill2](
	[Goods_num] [char](4) NOT NULL,
	[BILL_num] [char](10) NOT NULL,
	[bill_sum] [int] NULL,
 CONSTRAINT [fk_goodsinfor1] PRIMARY KEY CLUSTERED 
(
	[Goods_num] ASC,
	[BILL_num] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PA【本文来自鸿网互联 (http://www.68idc.cn)】DDING OFF
GO
INSERT [dbo].[bill2] ([Goods_num], [BILL_num], [bill_sum]) VALUES (N'1   ', N'2010010101', 1)
INSERT [dbo].[bill2] ([Goods_num], [BILL_num], [bill_sum]) VALUES (N'1   ', N'2010010102', 3)
INSERT [dbo].[bill2] ([Goods_num], [BILL_num], [bill_sum]) VALUES (N'2   ', N'2010010101', 2)
INSERT [dbo].[bill2] ([Goods_num], [BILL_num], [bill_sum]) VALUES (N'3   ', N'2010010102', 4)
/****** Object:  Check [MemberSex]    Script Date: 12/26/2014 17:54:54 ******/
ALTER TABLE [dbo].[Member]  WITH CHECK ADD  CONSTRAINT [MemberSex] CHECK  (([MemberSex]='男' OR [MemberSex]='女'))
GO
ALTER TABLE [dbo].[Member] CHECK CONSTRAINT [MemberSex]
GO
/****** Object:  ForeignKey [FK__BILL__MemberID__060DEAE8]    Script Date: 12/26/2014 17:54:54 ******/
ALTER TABLE [dbo].[BILL]  WITH CHECK ADD FOREIGN KEY([MemberID])
REFERENCES [dbo].[Member] ([MemberID])
GO
/****** Object:  ForeignKey [FK__bill2__BILL_num__1273C1CD]    Script Date: 12/26/2014 17:54:54 ******/
ALTER TABLE [dbo].[bill2]  WITH CHECK ADD FOREIGN KEY([BILL_num])
REFERENCES [dbo].[BILL] ([BILL_num])
GO
/****** Object:  ForeignKey [FK__bill2__Goods_num__117F9D94]    Script Date: 12/26/2014 17:54:54 ******/
ALTER TABLE [dbo].[bill2]  WITH CHECK ADD FOREIGN KEY([Goods_num])
REFERENCES [dbo].[Goods] ([Goods_num])
GO
/****** Object:  ForeignKey [FK__Customers__BILL___0AD2A005]    Script Date: 12/26/2014 17:54:54 ******/
ALTER TABLE [dbo].[Customers]  WITH CHECK ADD FOREIGN KEY([BILL_num])
REFERENCES [dbo].[BILL] ([BILL_num])
GO
登录后复制
截图如下:


启科网络PHP商城系统
启科网络PHP商城系统

启科网络商城系统由启科网络技术开发团队完全自主开发,使用国内最流行高效的PHP程序语言,并用小巧的MySql作为数据库服务器,并且使用Smarty引擎来分离网站程序与前端设计代码,让建立的网站可以自由制作个性化的页面。 系统使用标签作为数据调用格式,网站前台开发人员只要简单学习系统标签功能和使用方法,将标签设置在制作的HTML模板中进行对网站数据、内容、信息等的调用,即可建设出美观、个性的网站。

启科网络PHP商城系统 0
查看详情 启科网络PHP商城系统


最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号