網(wǎng)上購物車數(shù)據(jù)庫設(shè)計(20210215011237)_第1頁
網(wǎng)上購物車數(shù)據(jù)庫設(shè)計(20210215011237)_第2頁
網(wǎng)上購物車數(shù)據(jù)庫設(shè)計(20210215011237)_第3頁
網(wǎng)上購物車數(shù)據(jù)庫設(shè)計(20210215011237)_第4頁
網(wǎng)上購物車數(shù)據(jù)庫設(shè)計(20210215011237)_第5頁
已閱讀5頁,還剩2頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、精品文檔 一、概述 網(wǎng)上購物店的數(shù)據(jù)模型,它主要模式有產(chǎn)品:product ,帳戶:Account,定單: Order。和產(chǎn)品相關(guān)的表有 category ,product,item, inventory, supplier; 和用戶相關(guān)表有的accou nt ,sig non , profile ;和定單相關(guān)的表有 orders,orderstatus,lineitem,他們之間的整體關(guān)系如下. ERD圖 FK:Foreig n Key 二、帳戶模型 帳戶模型,記錄者用戶的登錄名稱,密碼。以及個人信息如地址,性名,電話等, 還有它在系統(tǒng)中的profile 信息。表有Account主鍵是use

2、rID,它記錄用戶的基 本信息,如 email, name 等。Sig non 表記錄者 userID 和 password, Profile 表 記錄者用戶的登錄系統(tǒng)的系統(tǒng)設(shè)置??梢愿鶕?jù)用戶的類型,顯示不同的登錄信息。 (1) account 表 create table acco unt ( userid varchar(80) not nu II, email varchar(80) not nu II, n ame varchar(80) not n ull, status char(2) nu II, addr1 varchar(80) not null, addr2 varchar

3、(40) null, city varchar(80) not n ull, state varchar(80) not n ull, zip varchar(20) not n ull, country varchar(20) not n ull, phone varchar(80) not n ull, con stra int pk_acco unt primary key (userid) ) 說明:primary key是userID,它記錄帳戶的基本信息。 (2) Sig non 表 create table sig non ( user name varchar(25) not

4、n ull, password varchar(25) not n ull, con stra int pk_sig non primary key (user name) ) 說明:記錄登錄名和密碼。 (3) Profile 表 create table profile ( userid varchar(80) not nu II, Ian gpref varchar(80) not nu II, favcategory varchar(30), mylistopt int, bann eropt int, con stra int pk_profile primary key (useri

5、d) ) 說明:用戶的登錄信息,方便個性化定制。 (4) Bannerdata 表 create table bann erdata ( favcategory varchar(80) not n ull, bannern ame varchar(255) n ull, con stra int pk_ba nn erdata primary key (favcategory) ) 說明:記錄不同的登錄信息。 三、產(chǎn)品模型 產(chǎn)品的模型主要有分類,它是產(chǎn)品的大類。表category就是記錄分類名稱,描 述信息。Product 對多的關(guān)系。 Item記錄產(chǎn)品的 記錄每個產(chǎn)品的基本信息,包括產(chǎn)品名稱

6、,和產(chǎn)品的描述。它是 Supplier 表 記錄產(chǎn)品的提供者信息,包括提供者的名稱,地址,狀態(tài)等。 提供者,產(chǎn) 品ID,價格,狀態(tài)。Inventory 表記錄產(chǎn)品的數(shù)量。關(guān)系如下: (1) category 表 create table category ( catid char(10) not null, n ame varchar(80) n ull, desc n varchar(255) n ull, con stra int pk_category primary key (catid) ) (2) product 表 create table product ( productid

7、 char(10) not n ull, category char(10) not n ull, n ame varchar(80) n ull, desc n varchar(255) n ull, con stra int pk_product primary key (productid), con stra int fk_product_1 foreig n key (category) refere nces category (catid) ) (3) item 表 create table item ( itemid char(10) not null, productid c

8、har(10) not n ull, listprice decimal(10,2) null,.unitcost decimal(10,2) null, supplier int n ull, status char(2) nu II, attrl varchar(80) null, attr2 varchar(80) null, attr3 varchar(80) nu II, attr4 varchar(80) null, attr5 varchar(80) nu II, con stra int pk_item primary key (itemid), constraint fk_i

9、tem_1 foreign key (productid) refere nces product (productid), con stra int fk_item_2 foreig n key (supplier) refere nces supplier (suppid) ) (4) inven tory 表 create table inven tory ( itemid char(10) not null, qty int not n ull ) (5) supplier 表 create table inven tory ( suppid int not n ull n ame v

10、archar(80) status char(2) attr1 varchar(80) attr2 varchar(80) city varchar(80) state varchar(80) zip char phone varchar(80) con stra int pk_supplier primary key (suppid), ) 四、定單模型 定單記錄用戶的選擇產(chǎn)品信息,數(shù)量,表主要有Orders,記錄用戶的地址,帳戶 信息,總金 額。Orderstatus 記錄定單狀態(tài)。Lin eitem 記錄定單中的產(chǎn)品數(shù)量,單位價格, 產(chǎn)品ID。 (1) orders 表 create t

11、able orders ( orderid int not nu II, userid varchar(80) not nu II, orderdate date not n ull, shipaddr1 varchar(80) not n ull, shipaddr2 varchar(80) null, shipcity varchar(80) not nu II, shipstate varchar(80) not nu II, shipzip varchar(20) not n ull, shipco untry varchar(20) not n ull, billaddr1 varc

12、har(80) not null, billaddr2 varchar(80) null, billcity varchar(80) not null, billstate varchar(80) not null, billzip varchar(20) not null, billco untry varchar(20) not n ull, courier varchar(80) not nu II, totalprice nu mber(10,2) not nu II, billt on ame varchar(80) not n ull, shipt on ame varchar(8

13、0) not n ull, creditcard varchar(80) not n ull, exprdate char(7) not nu II, cardtype varchar(80) not n ull, locale varchar(20) not n ull, con stra int pk_orders primary key (orderid), con stra int fk_orders_1 foreig n key (userid) refere nces acco unt (userid) ) 定單的信息。 (2) Orderstatus 表 create table

14、 orderstatus ( orderid int not nu II, linenum int not n ull, timestamp date not n ull, status char(2) not nu II, con stra int pk_orderstatus primary key (orderid, li nenu m), con stra int fk_orderstatus_1 foreig n key (orderid) refere nces orders (orderid) ) 定單中的產(chǎn)品狀態(tài) (3) lineitem 表 create table lin eitem ( orderid int not nu II, linenum int not n ull, item

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論