网上商城数据库表结构(优选.)
网上购物商城数据库设计

网上购物商城数据库设计网上购物商城数据库设计一、概述网上购物店的数据模型,它主要模式有产品:product ,帐户:Account,定单:Order。
和产品相关的表有category ,product,item, inventory, supplier;和用户相关表有的account ,signon ,profile;和定单相关的表有orders,orderstatus,lineitem ,他们之间的整体关系如下. ERD图FK:Foreign Key二、帐户模型帐户模型,记录者用户的登录名称,密码。
以及个人信息如地址,性名,电话等,还有它在系统中的profile信息。
表有Account 主键是userID,它记录用户的基本信息,如email,name等。
Signon 表记录者userID和password,Profile表记录者用户的登录系统的系统设置。
可以根据用户的类型,显示不同的登录信息。
(1)account表create table account (userid varchar(80) not null,email varchar(80) not null,name varchar(80) not null,status char(2) null,addr1 varchar(80) not null,addr2 varchar(40) null,city varchar(80) not null,state varchar(80) not null,zip varchar(20) not null,country varchar(20) not null,phone varchar(80) not null,constraint pk_account primary key (userid))说明:primary key是userID,它记录帐户的基本信息。
(2)Signon 表create table signon (username varchar(25) not null,password varchar(25) not null,constraint pk_signon primary key (username))说明:记录登录名和密码。
ecshop数据库表结构.

ECShop 2.7.2版本,数据库表注:1、颜色为蓝色的字,是本人所写,有待讨论验证的地方。
2、颜色为红色的字,是新增的字段。
(改文档是基于网上下载的老版本的数据字典修改而成,已经检查了所有字段,修改的修改,增加的增加)。
ecs_account_log //用户账目日志表ecs_ad //广告表(位置,类型,名称,链接,图片,开始,结束,广告主相关信息,点击是否显示)ecs_admin_action //管理权限分配(父类ID,权限代码)(感觉像是规定好的一些数据,安装的时候就有)ecs_admin_log //管理日志(登陆时间,登陆ID,操作描述,IP)ecs_admin_message //管理留言(发送id,接收id,发送日期,阅读日期,是否已读,是否删除,标题,内容)ecs_admin_user //管理员管理(用户名,email,密码,加入时间,最后登陆时间,最后登陆IP,权限等)ecs_adsense //广告相关统计(来源广告,来源位置,点击)ecs_ad_custom //ecs_ad_position //广告位(名称,宽,高,描述,样式)ecs_affiliate_log //(用户推荐的操作日志?)ecs_agency //广告相关统计(来源广告,来源位置,点击)ecs_area_region //配送区域关联(配送区域ID,具体地址ID)ecs_article //文章(分类ID,标题,内容,作者,作者email,关键字, 类型,是否显示,添加时间,文件地址,打开类型)ecs_article_cat //文章分类(名称,类型,关键字,描述,排序,是否导航显示)ecs_attribute //商品属性ecs_auction_log //商品拍卖表ecs_auto_manage //自动上下架表ecs_back_goods //ecs_back_order //ecs_bonus_type //红包类型(名称,金额, 发放起日期,发放结束期,使用起始日期, 使用结束日期, 发放类型, 金额下限,(按订单发放),金额上限)ecs_booking_goods //缺货登记(登记用户ID,email,电话,商品ID,描述,数量,登记时间,是否已处理,处理管理员,处理时间,处理备注)ecs_brand //品牌(名称,logo,描述, 链接,排序,是否显示)ecs_card // 祝福贺卡(名称,图片,费用,免费额度,描述)ecs_cart//购物车(用户ID,session_id,商品ID,商品编号,商品名称,市场价,购买价,数量,属性,是否真实商品,扩展代码,父类ID, 类型,是否赠品,能否处理)ecs_category //商品分类(名称,关键字,描述,父类ID,排序,是否有子类,模板文件,数量单位,是否导航显示)ecs_cat_recommend // 什么推荐?ecs_collect_goods //收藏(用户ID,商品ID,收藏时间)ecs_comment //评论(类型,类型ID,email,用户名,内容,评星,添加时间,IP,状态, 父类ID)ecs_crons //计划任务ecs_delivery_goods //ecs_delivery_order //ecs_email_list //邮件订阅列表ecs_email_sendlist //邮件队列ecs_error_logecs_exchange_goods //交换商品??ecs_favourable_activity //优惠活动ecs_feedback //用户留言(父类ID,用户ID,用户名,内容,评星,添加时间,IP,状态,父类ID)ecs_friend_link//友情链接(名称,链接,logo,排序)ecs_goods //商品(分类ID,名称,点击,品牌ID,供应商名称,库存,重量,市场价,售价,fitting_price(?), 促销开始日期,结束日期, 警告数量,关键字, 简介,描述,缩略图,图, 原图,是否成为赠品,扩展代码,是否上架,是否单独销售,是否关联,配件关联,是否赠品,能否世为赠品,单位,添加时间,排序,是否回收,精品,新品,推荐,热销,红包ID,更新日期,商品类型, 商品备注,首页轮播)ecs_goods //商品信息ecs_goods_activity //促销活动ecs_goods_article //商品文章关联(gid,aid)ecs_goods_attr //商品属性(商品ID,图片,描述,缩略图, 原图)ecs_goods_catecs_goods_gallery //商品相册(商品ID,图片,描述,缩略图,原图)ecs_goods_type //商品类型(名称,状态)ecs_group_goodsecs_keywordsecs_link_goods //商品关联(商品ID,关联ID,单双向)ecs_mail_templates //邮件样式(代码,是否html,名称, 样式,最后修改日期)ecs_member_price //会员价(商品ID,会员等级,会员价)ecs_navecs_order_action //订单处理(订单ID,商品ID,商品名称,商品编号,商品数量,市场价,订单价,商品属性,配送数量,是否真实商品,扩展代码,父类ID,是否赠品)ecs_order_goods //订单一商品(订单ID,商品ID,商品名称,商品编号,商品数量,市场价,订单价,商品属性,配送数量,是否真实商品,扩展代码, 父类ID,是否赠品)ecs_order_info //订单详细信息ecs_pack // 包装(名称,图片,费用,免费额,描述)ecs_package_goods //包装商品ecs_payment //支付工具(代码,名称,费用,描述,排序, 配置,状态,is_cod(?))ecs_pay_log //支付记录ecs_plugins //插件(代码,版本,库,签名, 安装日期)ecs_productsecs_region //地方数据ecs_reg_extend_infoecs_reg_fieldsecs_roleecs_searchengineecs_sessions //保存session的ecs_sessions_dataecs_shipping //配送(代码,名称,描述,保价费,状态)ecs_shipping_area //配送区域(序列配置)ecs_shop_config //设置(父类ID,代码,类型,范围,文件夹,值)ecs_snatch_log // 夺宝奇兵出价记录ecs_stats //访问记录(时间,IP,访问次数,浏览器,系统,语言,地区,来源域名,来源地址,关键字,进入链接)ecs_suppliersecs_tag //用户标签ecs_template //模板区域(文件名,区域,模板库,排序,id,数量,类型,模板)ecs_topicecs_usersecs_user_account //会员账户(用户ID,管理员,总额,添加时间,支付时间,管理备注,用户备注,处理类型,支付工具,是否支付)ecs_user_addressecs_user_bonus //红包ecs_user_feedecs_user_rankecs_virtual_cardecs_volume_priceecs_vote //在线调查。
(完整版)网上商城项目数据库表

网上商城项目数据库表*****************************************************' 添加商品记录同步添加库存记录的触发器'*****************************************************IF EXISTS (SELECT name FROM sysobjects WHERE name = 'AddGoodsInfo' AND type = 'TR') DROP TRIGGER AddGoodsInfoGOCREATE TRIGGER AddGoodsInfo ON [dbo].[GoodsInfo]FOR INSERTASINSERT INTO GoodsSave select GoodsID,GoodsName,0,0,getdate(),getdate() from insertedGO' 删除商品记录同步删除库存记录的触发器'*****************************************************IF EXISTS (SELECT name FROM sysobjects WHERE name = 'DelGoodsInfo' AND type = 'TR') DROP TRIGGER DelGoodsInfoGOCREATE TRIGGER DelGoodsInfo ON [dbo].[GoodsInfo]FOR DELETEASDELETE from GoodsSave where GoodsID = (SELECT GoodsID FROM deleted)GO'*****************************************************' 重新同步商品在库存表中的对应记录的存储过程'*****************************************************CREATE PROCEDURE BindGoodsToSave ASIF EXISTS (SELECT name FROM sysobjects WHERE name = 'GoodsSave' AND type = 'U') BEGINDROP TABLE GoodsSavecreate table GoodsSave (GoodsSaveID integer identity,GoodsID integer null,GoodsName nvarchar(100) null,SaveNum integer null default 0,SaveAddNum integer null default 0,SaveTime datetime null default getdate(),SaveAddTime datetime null default getdate(),constraint PK_GOODSSAVE primary key (GoodsSaveID))ENDELSEBEGINcreate table GoodsSave (GoodsSaveID integer identity,GoodsID integer null,GoodsName nvarchar(100) null,SaveNum integer null default 0,SaveAddNum integer null default 0,SaveTime datetime null default getdate(),SaveAddTime datetime null default getdate(),constraint PK_GOODSSAVE primary key (GoodsSaveID))ENDINSERT INTO GoodsSave(GoodsID,GoodsName) select GoodsID,GoodsName from GoodsInfo order by GoodsID'*****************************************************' 按日期和月份统计注册人数的存储过程'*****************************************************CREATE procedure GetRegUsers@id intASdeclare @table table(ID int IDENTITY(1,1),RegDate nvarchar(10),RegNum int) declare @tempId int --临时表记录IDdeclare @tempRegDate nvarchar(10) --临时表日期set nocount onif (@id = 0)begininsert into @table(RegDate)select distinct convert(char(10),UserCreateTime,120) from Users order by convert(char(10),UserCreateTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from Users whereconvert(char(10),UserCreateTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorendelsebegininsert into @table(RegDate)select distinct convert(char(7),UserCreateTime,120) from Users order by convert(char(7),UserCreateTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from Users whereconvert(char(7),UserCreateTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorset nocount offselect * from @table where RegDate is not nullGO'*****************************************************' 按日期和月份统计用户订单的存储过程'*****************************************************CREATE procedure GetUserOrders@id intASdeclare @table table(ID int IDENTITY(1,1),RegDate nvarchar(10),RegNum int) declare @tempId int --临时表记录IDdeclare @tempRegDate nvarchar(10) --临时表日期set nocount onif (@id = 0)begininsert into @table(RegDate)select distinct convert(char(10),OrderTime,120) from GoodsOrder order by convert(char(10),OrderTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from GoodsOrder where convert(char(10),OrderTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorendbegininsert into @table(RegDate)select distinct convert(char(7),OrderTime,120) from GoodsOrder order by convert(char(7),OrderTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from GoodsOrder where convert(char(7),OrderTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorendset nocount offselect * from @table where RegDate is not nullGO。
电商数据库表结构设计

电商数据库表结构设计电商数据库表结构设计是指在电商网站运营过程中,为了方便数据存储和管理,需要对数据库进行合理的表结构设计。
以下是电商数据库表结构设计的详细内容:一、用户表用户表是电商网站最基本的数据存储单元,用于存储用户信息。
这个表通常包括以下字段:1. 用户ID:唯一标识一个用户的数字或字母组合。
2. 用户名:用户在网站上注册时所填写的用户名。
3. 密码:用户在网站上注册时所设置的密码。
4. 昵称:用户在网站上使用的昵称。
5. 真实姓名:用户真实姓名。
6. 性别:男或女。
7. 生日:用户出生日期。
8. 手机号码:用于接收短信验证码等信息。
9. 邮箱地址:用于接收邮件通知等信息。
10. 地址信息:包括省份、城市、区县、详细地址等字段。
11. 注册时间:记录用户在网站上注册的时间点。
二、商品表商品表是电商网站中最重要的数据存储单元,用于存储商品信息。
这个表通常包括以下字段:1. 商品ID:唯一标识一个商品的数字或字母组合。
2. 商品名称:商品名称,例如“iPhone 12 Pro”。
3. 商品价格:商品销售价格,单位为人民币元。
4. 商品描述:商品的详细描述信息。
5. 商品分类:商品所属的分类,例如“手机”、“电脑”等。
6. 商品图片:商品的图片地址,可以存储多张图片地址。
7. 库存数量:商品的库存数量,用于控制销售量和库存量之间的平衡。
8. 销售数量:记录商品的销售数量。
9. 上架时间:记录商品上架时间,用于控制商品展示顺序和推荐算法等。
10. 下架时间:记录商品下架时间,用于控制商品展示顺序和推荐算法等。
三、订单表订单表是电商网站中用于存储订单信息的数据单元。
这个表通常包括以下字段:1. 订单ID:唯一标识一个订单的数字或字母组合。
2. 用户ID:关联用户表中的用户ID字段,表示该订单是哪个用户下单的。
3. 订单状态:表示订单当前所处状态,例如“待付款”、“已发货”等状态。
4. 订单总价:记录该订单中所有商品价格之和,单位为人民币元。
(完整版)网上商城项目数据库表

网上商城项目数据库表*****************************************************' 添加商品记录同步添加库存记录的触发器'*****************************************************IF EXISTS (SELECT name FROM sysobjects WHERE name = 'AddGoodsInfo' AND type = 'TR') DROP TRIGGER AddGoodsInfoGOCREATE TRIGGER AddGoodsInfo ON [dbo].[GoodsInfo]FOR INSERTASINSERT INTO GoodsSave select GoodsID,GoodsName,0,0,getdate(),getdate() from insertedGO' 删除商品记录同步删除库存记录的触发器'*****************************************************IF EXISTS (SELECT name FROM sysobjects WHERE name = 'DelGoodsInfo' AND type = 'TR') DROP TRIGGER DelGoodsInfoGOCREATE TRIGGER DelGoodsInfo ON [dbo].[GoodsInfo]FOR DELETEASDELETE from GoodsSave where GoodsID = (SELECT GoodsID FROM deleted)GO'*****************************************************' 重新同步商品在库存表中的对应记录的存储过程'*****************************************************CREATE PROCEDURE BindGoodsToSave ASIF EXISTS (SELECT name FROM sysobjects WHERE name = 'GoodsSave' AND type = 'U') BEGINDROP TABLE GoodsSavecreate table GoodsSave (GoodsSaveID integer identity,GoodsID integer null,GoodsName nvarchar(100) null,SaveNum integer null default 0,SaveAddNum integer null default 0,SaveTime datetime null default getdate(),SaveAddTime datetime null default getdate(),constraint PK_GOODSSAVE primary key (GoodsSaveID))ENDELSEBEGINcreate table GoodsSave (GoodsSaveID integer identity,GoodsID integer null,GoodsName nvarchar(100) null,SaveNum integer null default 0,SaveAddNum integer null default 0,SaveTime datetime null default getdate(),SaveAddTime datetime null default getdate(),constraint PK_GOODSSAVE primary key (GoodsSaveID))ENDINSERT INTO GoodsSave(GoodsID,GoodsName) select GoodsID,GoodsName from GoodsInfo order by GoodsID'*****************************************************' 按日期和月份统计注册人数的存储过程'*****************************************************CREATE procedure GetRegUsers@id intASdeclare @table table(ID int IDENTITY(1,1),RegDate nvarchar(10),RegNum int) declare @tempId int --临时表记录IDdeclare @tempRegDate nvarchar(10) --临时表日期set nocount onif (@id = 0)begininsert into @table(RegDate)select distinct convert(char(10),UserCreateTime,120) from Users order by convert(char(10),UserCreateTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from Users whereconvert(char(10),UserCreateTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorendelsebegininsert into @table(RegDate)select distinct convert(char(7),UserCreateTime,120) from Users order by convert(char(7),UserCreateTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from Users whereconvert(char(7),UserCreateTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorset nocount offselect * from @table where RegDate is not nullGO'*****************************************************' 按日期和月份统计用户订单的存储过程'*****************************************************CREATE procedure GetUserOrders@id intASdeclare @table table(ID int IDENTITY(1,1),RegDate nvarchar(10),RegNum int) declare @tempId int --临时表记录IDdeclare @tempRegDate nvarchar(10) --临时表日期set nocount onif (@id = 0)begininsert into @table(RegDate)select distinct convert(char(10),OrderTime,120) from GoodsOrder order by convert(char(10),OrderTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from GoodsOrder where convert(char(10),OrderTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorendbegininsert into @table(RegDate)select distinct convert(char(7),OrderTime,120) from GoodsOrder order by convert(char(7),OrderTime,120) descdeclare _cursor cursor for select Id,RegDate from @tableopen _cursorfetch next from _cursor into @tempId,@tempRegDatewhile @@fetch_status = 0beginupdate @table set RegNum=(select count(UserID) from GoodsOrder where convert(char(7),OrderTime,120) = @tempRegDate)where ID = @tempIdfetch next from _cursor into @tempId,@tempRegDateendclose _cursordeallocate _cursorendset nocount offselect * from @table where RegDate is not nullGO。
(2021更新)国家开放大学电大《MySQL数据库应用》机考终结性考试3套真题题库及答案10

(精华版)国家开放大学电大《MySQL数据库应用》机考终结性考试3套真题题库及答案题库一试卷总分:100 答题时间:60分钟客观题一、单选题(共25题,共75分)1.下而的选项不是关系数据库基本特征的是()。
A不同的列应有不同的数据类型2.下而列出的数据库管理技术发展的三个阶段中,没有专门的软件对数据进行管理的是()。
1.人工管理阶段11.文件系统阶段III.数据库阶段D只有I3.描述数据库全体数据的全局逻辑结构和特性的是()。
A模式D用户模式4.下列四项中,不属于数据库系统特点的是()oC数据冗余度高5.关系模型中实现实体间N: M联系是通过增加一个()oA关系实现6.数据库与文件系统的根本区别在于()C数据的结构化7.在SQL语言中的视图VIEW是数据库的()。
A外模式8.SQL语言集数据查询、数据操纵、数据定义和数据控制功能于一体,其中,CREATE> DROP、ALTER 语句是实现哪种功能()oC数据定义9.“为哪些关系,在哪些属性上,创建什么样的索引”这一设计内容应该属于()设计阶段。
C物理设计10.在网上购物流程中,位于“用户注册”与“选购产品”之间的步骤是()oA浏览产品11.从ER图导出关系模型时,如果实体间的联系是M: N的,下列说法中正确的是()oD增加一个关系表示联系,其中纳入M方和N方的关键字12.“汽车用品网上商城”数据库包括()张表。
13.连接MySQL服务器的指令是?()C mysql -u root -p test14.下列选项中,不属于数据库特点的是()oC数据冗余很高15.下列SQL语句中,创建关系表的是()B CREATE16.数据库管理系统能实现对数据的查询、插入、删除等操作,这种功能是()。
C数据操纵功能17.有订单表orders,包含用户信息userid,产品信息productid,以下()语句能够返回至少被订购过两回的productidD selectproductidfromordersgroupbyproductidhavingcount(productid)>118.创建用户的命令是()B createuser19.SELECT LOCATE( 'to' , 'Welcome to China/ )的结果是()C 920.SELECT * FROM city limit 5, 10 描述正确的是()C获取第6条到第15条记录21.下面SQL是来源于考试成绩表t_exam:学号stuld、科目编号subld、成绩score,考试日期:ex_dateo有以下sql,它表示的意思是:()Select stu_id, subld, count (*) as xFrom t_examWhere ex_date=, 2008-08-08JGroup stu_id, subldHaving count(*)>1Order by x descB找出'2008-08-08'这天,某科考试2次及以上的学生记录,考试次数多的放在前而22.DECIMAL是()数据类型A可变精度浮点值23.在表中设置外键实现的是哪一类数据完整性()B引用完整性24.关系数据库中,主键是()D为标识表中唯一的实体25.创建表时,不允许某列为空可以使用()A NOTNULL二、多选题(共4题,共20分)1.以下说法正确的是()A字符型既可用单引号也可用双引号将串值括起来B字符型的87398143不参与计算的D数值型的87398143将参与计算2.导致输入值无效原因是()A对于数据或时间列,值可能超出范围B对于字符串列,字符串可能太长C对于非NULL列赋予NULL值D对于数值类型列赋予非合法的字符值3.关于group by以下语句正确的是()B SELECT SUM(sales) FROM Store GROUP BY salesC SELECT name, price, SUM(sales) FROM Store GROUP BY name, priceD SELECT name, SUM(sales) FROM Store GROUP BY name4.关于检索结果排序,正确的是()A关键字DESC表示降序,ASC表示升序C如果指定多列排序,可以在任意列使用升序或降序关键字三、综合分析题(共1题,共5分)1.研究所有多名科研人员,每一个科研人员只属于一个研究所,研究所有多个科研项目,每个科研项目有多名科研人员参加,每个科研人员可以参加多个科研项目。
网上商城数据库分析

网上商城数据库分析,设计1.网上商城网上商城类似于现实世界当中的商店,差别是利用电子商务的各种手段,达成从买到卖的过程的虚拟商店,从而减少中间环节,消除运输成本和代理中间的差价,造就对普通消费,和加大市场流通带来巨大的发展空间。
尽能的还消费者以利益,带动公司发展和企业腾飞,引导国民经济稳定快速发展,推动国内生产总值。
在现如今的WEB2.0时代,新的产业在不断衍生,电子商务的兴起,为互联网创业者提供了更多的机会。
本项目基于网上商城在现阶段及未来的发展而开发的电子商务应用,为消费者提供更好更快捷的服务,同时获得利润。
2.参考项目项目的设计离不开原有的成功的项目以及别的公司的案例,例如淘宝网、亚马逊、当当网以及新发展起来的麦考林、凡客诚品等等,虽然经营的商品及模式不同,但是在技术上有很多的相同点。
特别是在数据库的设计中,像用户信息表的设计,商品类别的设计,订单的设计等等,字段都是有很大程度上相同的,所以在实际的项目设计中可以参考这些成功的电子商务网站。
3.数据库设计数据库设计(Database Design)是指根据用户的需求,在某一具体的数据库管理系统上,设计数据库的结构和建立数据库的过程。
数据库设计是建立数据库及其应用系统的技术,是信息系统开发和建议中的核心技术。
由于数据库应用系统的复杂性,为了支持相关程序运行,数据库设计就变得异常复杂,因此最佳设计不可能一蹴而就,而只能是一种“反复探寻,逐步求精”的过程,也就是规划和结构化数据库中的数据对象以及这些数据对象之间关系的过程。
4.数据库设计的重要性良好的数据库设计对于一个高性能的应用程序非常重要,就像一个空气动力装置对于一辆赛车的重要性一样。
如果一辆汽车没有平滑的曲线,将会产生阻力从而变慢。
关系没有经过优化,数据库无法尽可能高效地运行。
应该把数据库的关系和性能看作是规范化的一部分。
除了性能以外的问题,就是维护的问题了,数据库应该易于维护。
这包括只存储数量有限的(如果有的话)重复性数据。
(完整)网上商城数据库表结构

字段名称
类型
说明
orderID
int
订单的ID,主健,关联到tb_Order中的orderID
goodsID
int
商品的ID,主健,关联到tb_Goods中的goodsID
6、管理员表(tb_Manage),记录网上商城管理员的登录名和密码
字段名称
类型
说明
managerName
varchar(20)
管理员登录名,主键
managerPWD城数据库(OnlineShop)各表结构设计:
1、顾客信息表(tb_Customer),记录顾客登录名、密码等相关信息
字段名称
类型
说明
customerName
nvarchar(20)
顾客的登录名称,主键
customerPass
varchar(20)
顾客的登录密码
customerTrueName
字段名称
类型
说明
goodsID
int
商品的ID,主健,自动加1
goodsName
nvarchar(50)
商品的名称
goodsTypeID
int
商品种类的ID,关联到tb_GoodsType表中的goodsTypeID
goodsDescript
nvarchar(max)
关于商品的一些介绍信息
goodsUnitPrice
int
订单的ID,主健,自动加1
customerName
nvarchar(20)
顾客登录用的名称
totalMoney
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
1、顾客信息表(tb_Customer),记录顾客登录名、密码等相关信息
字段名称
类型
说明
customerName
nvarchar(20)
顾客的登录名称,主键
customerPass
varchar(20)
顾客的登录密码
customerTrueName
nvarchar(20)
顾客的真实姓名,用来邮寄商品
ress
nvarchar(100)
顾客的联系地址,用来邮寄商品
customerPostCode
char(6)
顾客的邮政编码,用来邮寄商品
customerBirthday
smalldatetime
顾客的出生日期
customerPhone
varchar(20)
顾客的联系电话
customerEmail
varchar(50)
顾客的E-Mail地址
customerRegDate
smalldatetime
顾客在商城的注册日期,默认为当前日期(getdate())
customerQuestion
nvarchar(100)
获取密码的问题
customerAnswer
nvarchar(100)
获取密码时回答问题的答案
2、商品类型表(tb_GoodsType),记录商品类型的相关信息
字段名称
类型
说明
goodsTypeID
int
商品种类的ID,主键,自动加1
goodsTypeName
nvarchar(50)
商品种类的名称
3、商品表(tb_Goods),记录商品的相关信息
money
商品的价格
goodsImageName
nvarchar(50)
商品图片的名称,图片上传在服务器上指定的路径下
sellCount
int
商品销售的数量
goodsDate
smalldatetime
商品添加到网上商城的时间
4、订单表(tb_Order),记录顾客购物时所下的订单
字段名称
类型
说明
orderID
赠人玫瑰,手留余香。
字段名称
类型
说明
goodsID
int
商品的ID,主健,自动加1
goodsName
nvarchar(50)
商品的名称
goodsTypeID
int
商品种类的ID,关联到tb_GoodsType表中的goodsTypeID
goodsDescript
nvarchar(max)
关于商品的一些介绍信息
goodsUnitPrice
字段名称
类型
说明
managerName
varchar(20)
管理员登录名,主键
managerPWD
char(20)
管理员登录密码
最新文件----------------仅供参考--------------------已改成-----------word文本---------------------方便更改
5、订单详细表(tb_OrderDetail),记录顾客所下的订单的详细信息,即订单里包含的商品
字段名称
类型
说明
orderID
int
订单的ID,主健,关联到tb_Order中的orderID
goodsID
int
商品的ID,主健,关联到tb_Goods中的goodsID
6、管理员表(tb_Manage),记录网上商城管理员的登录名和密码
int
订单的ID,主健,自动加1
customerName
nvarchar(20)
顾客登录用的名称
totalMoney
money
订单的总金额
orderDate
smalldatetime
顾客下订单的日期,默认为当前时间(getdate())
orderState
char(1)
订单是否处理,0为未处理,1为已处理