




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
一、概述网上购物店的数据模型,它主要模式有产品: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)说明:记录登录名和密码。(3)Profile表create table profile (userid varchar(80) not null,langpref varchar(80) not null,favcategory varchar(30),mylistopt int,banneropt int,constraint pk_profile primary key (userid)说明:用户的登录信息,方便个性化定制。(4)Bannerdata 表create table bannerdata (favcategory varchar(80) not null,bannername varchar(255) null,constraint pk_bannerdata primary key (favcategory)说明:记录不同的登录信息。三、产品模型产品的模型主要有分类,它是产品的大类。表category 就是记录分类名称,描述信息。Product记录每个产品的基本信息,包括产品名称,和产品的描述。它是一对多的关系。Supplier 表记录产品的提供者信息,包括提供者的名称,地址,状态等。Item 记录产品的提供者,产品ID,价格,状态。Inventory 表记录产品的数量。关系如下:(1) category表create table category (catid char(10) not null,name varchar(80) null,descn varchar(255) null,constraint pk_category primary key (catid)(2)product表create table product (productid char(10) not null,category char(10) not null,name varchar(80) null,descn varchar(255) null,constraint pk_product primary key (productid),constraint fk_product_1 foreign key (category)references category (catid)(3) item表create table item (itemid char(10) not null,productid char(10) not null,listprice decimal(10,2) null,.unitcost decimal(10,2) null,supplier int null,status char(2) null,attr1 varchar(80) null,attr2 varchar(80) null,attr3 varchar(80) null,attr4 varchar(80) null,attr5 varchar(80) null,constraint pk_item primary key (itemid),constraint fk_item_1 foreign key (productid)references product (productid),constraint fk_item_2 foreign key (supplier)references supplier (suppid)(4) inventory 表create table inventory (itemid char(10) not null,qty int not null)(5)supplier表create table inventory (suppid int not nullname varchar(80) status char(2) attr1 varchar(80)attr2 varchar(80)city varchar(80)state varchar(80)zip char(6)phone varchar(80)constraint pk_supplier primary key (suppid),)四、定单模型定单记录用户的选择产品信息,数量,表主要有Orders,记录用户的地址,帐户信息,总金额。Orderstatus 记录定单状态。Lineitem 记录定单中的产品数量,单位价格,产品ID。(1)orders表create table orders (orderid int not null,userid varchar(80) not null,orderdate date not null,shipaddr1 varchar(80) not null,shipaddr2 varchar(80) null,shipcity varchar(80) not null,shipstate varchar(80) not null,shipzip varchar(20) not null,shipcountry varchar(20) not null,billaddr1 varchar(80) not null,billaddr2 varchar(80) null,billcity varchar(80) not null,billstate varchar(80) not null,billzip varchar(20) not null,billcountry varchar(20) not null,courier varchar(80) not null,totalprice number(10,2) not null,billtoname varchar(80) not null,shiptoname varchar(80) not null,creditcard varchar(80) not null,exprdate char(7) not null,cardtype varchar(80) not null,locale varchar(20) not null,constraint pk_orders primary key (orderid),constraint fk_orders_1 foreign key (userid)references account (userid)定单的信息。(2)Orderstatus表create table orderstatus (orderid int not null,linenum int not null,timestamp date not null,status char(2) not null,constraint pk_orderstatus primary key (orderid, linenum),constraint fk_orderstatus_1 foreign key (orderid)references orders (orderid)定单中的产品状态(3)lineitem表create table lineitem (orderid int not null,linenum int not null,
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年金融市场与投资试题及答案
- 防灾减灾主题班会方案
- 保险策划活动方案
- 市场营销消费者市场课件
- 学校农村班主任工作方案
- 机器视觉技术及应用 课件 任务3 图像操作与运算
- 湖北省宜昌金东方高级中学等部分示范学校2026届化学高二第一学期期中达标测试试题含解析
- 2026届福建省莆田四中、莆田六中高三上化学期中检测试题含解析
- 2025年教师资格考试《小学综合素质》真题及答案
- 2024年浙江省温州市苍南县智睿达联盟中考三模道德与法治试卷
- 浙江省湖州市2023-2024学年高二下学期6月期末考试历史试题
- JJF 2137-2024 表面铂电阻温度计校准规范
- 面向工业智能化时代的新一代工业控制体系架构白皮书
- 浙江省二轻集团招聘笔试题库2024
- 2024新版药品管理法培训课件
- 护士健康宣教指导手册系列老年病房
- 中建三局三公司安装分公司劳务企业定额
- 狼疮肾炎的营养支持策略
- 初中数学“综合与实践”如何开展项目式学习义务教育课程方案和课程标准国家级示范培训课件
- 2024年广东梅州市梅江区总工会社会化工会工作者招聘笔试冲刺题(带答案解析)
- 一二手联动培训课件
评论
0/150
提交评论