<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Sealyu

    --- 博客已遷移至: http://www.sealyu.com/blog

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評(píng)論 :: 0 Trackbacks

    一、概述

    網(wǎng)上購物店的數(shù)據(jù)模型,它主要模式有產(chǎn)品:product ,帳戶:Account定單:Order。和產(chǎn)品相關(guān)的表有category product,item, inventory, supplier;和用戶相關(guān)表有的account signon profile和定單相關(guān)的表有orders,orderstatus,lineitem ,他們之間的整體關(guān)系如下.

    ERD

    FK:Foreign Key

    二、帳戶模型

    帳戶模型,記錄者用戶的登錄名稱,密碼。以及個(gè)人信息如地址,性名,電話等,還有它在系統(tǒng)中的profile信息。表有Account 主鍵是userID,它記錄用戶的基本信息,如email,name等。Signon 表記錄者userIDpasswordProfile表記錄者用戶的登錄系統(tǒng)的系統(tǒng)設(shè)置。可以根據(jù)用戶的類型,顯示不同的登錄信息。

    1account

    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 keyuserID,它記錄帳戶的基本信息。

    2Signon

    create table signon (

    username varchar(25) not null,

    password varchar(25) not null,

    constraint pk_signon primary key (username)

    )

    說明:記錄登錄名和密碼。

    3Profile

    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)

    )

    說明:用戶的登錄信息,方便個(gè)性化定制。

    4Bannerdata

    create table bannerdata (

    favcategory varchar(80) not null,

    bannername varchar(255) null,

    constraint pk_bannerdata primary key (favcategory)

    )

    說明:記錄不同的登錄信息。

    三、產(chǎn)品模型

    產(chǎn)品的模型主要有分類,它是產(chǎn)品的大類。表category 就是記錄分類名稱,描述信息。Product

    記錄每個(gè)產(chǎn)品的基本信息,包括產(chǎn)品名稱,和產(chǎn)品的描述。它是一對(duì)多的關(guān)系。Supplier

    記錄產(chǎn)品的提供者信息,包括提供者的名稱,地址,狀態(tài)等。Item 記錄產(chǎn)品的提供者,產(chǎn)

    ID,價(jià)格,狀態(tài)。Inventory 表記錄產(chǎn)品的數(shù)量。關(guān)系如下:

    1 category

    create table category (

    catid char(10) not null,

    name varchar(80) null,

    descn varchar(255) null,

    constraint pk_category primary key (catid)

    )

    2product

    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

    )

    5supplier

    create table inventory (

    suppid int not null

    name 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),

    )

    四、定單模型

    定單記錄用戶的選擇產(chǎn)品信息,數(shù)量,表主要有Orders,記錄用戶的地址,帳戶信息,總金

    額。Orderstatus 記錄定單狀態(tài)。Lineitem 記錄定單中的產(chǎn)品數(shù)量,單位價(jià)格,產(chǎn)品ID

    1orders

    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)

    )

    定單的信息。

    2Orderstatus

    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)

    )

    定單中的產(chǎn)品狀態(tài)

    3lineitem

    create table lineitem (

    orderid int not null,

    linenum int not null,

    itemid char(10) not null,

    quantity int not null,

    unitprice number(10,2) not null,

    constraint pk_lineitem primary key (orderid, linenum),

    constraint fk_lineitem_1 foreign key (orderid)

    references orders (orderid)

    )
    posted on 2009-10-27 21:11 seal 閱讀(598) 評(píng)論(0)  編輯  收藏 所屬分類: web綜合
    主站蜘蛛池模板: 亚洲av永久中文无码精品综合 | 国产成人综合亚洲AV第一页| 亚洲综合在线一区二区三区| 国产91免费视频| 亚洲日韩中文字幕| 国产一区二区三区免费| 亚洲成av人在线视| 久久综合九色综合97免费下载| 免费国产黄网站在线观看| 亚洲国产精品无码久久一区二区| 久久av无码专区亚洲av桃花岛| 亚洲av永久综合在线观看尤物| 国产亚洲视频在线观看| 国产男女猛烈无遮挡免费视频 | 亚洲日本一区二区三区在线不卡| 日本亚洲欧洲免费天堂午夜看片女人员 | 亚洲国产精品自在线一区二区 | 亚洲国产精品无码成人片久久| 亚洲a视频在线观看| 无码一区二区三区AV免费| 亚洲风情亚Aⅴ在线发布| vvvv99日韩精品亚洲| 久久国产乱子伦精品免费午夜| 大学生一级毛片免费看| 亚洲av永久无码| 四虎永久免费地址在线观看| 国内精品99亚洲免费高清| 亚洲VA中文字幕无码毛片| 100000免费啪啪18免进| 另类小说亚洲色图| 亚洲VA中文字幕不卡无码| 丁香花免费完整高清观看 | 国产真人无遮挡作爱免费视频| 亚洲大片在线观看| 成年女人男人免费视频播放| 一级做a爰片久久毛片免费陪 | 亚洲熟妇色自偷自拍另类| 特级淫片国产免费高清视频| 日韩a毛片免费观看| 91在线精品亚洲一区二区| 精品久久久久久久免费加勒比|