资源描述:
《网上书城数据库设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.用户表(users):字段名类型备注uidInt(ll)主键uloginidVarchar(20)用户登录名upwdVarchar(40)用户密码unameVarchar(lOO)用户真实姓名uphoneVarchar(100)用户电话uaddressVarchar(100)用户住址umailVarchar(lOO)用户邮箱uregistertimeVarchar(lOO)用户注册时间ulastlogintimeVarchar(lOO)最后一次登录时间upictureVarchar(200)用户头像otherlVarchar
2、(lOO)备用1other2Int(ll)备用2other3Int(ll)备用32.订单表(orders):字段名类型备注oidVarcahr(100)主键otimeVarchar(100)产生订单的时间ouidInt(ll)下订单用户oreceiveVarchar(200)收单人oaddressVarchar(1000)收单地址ophoneVarchar(lOO)收单人电话opriceVarchar(lOO)总金额opaymethodVarchar(20)支付方式opaybankVarchar(20)银行ostateInt(l
3、l)处理状态(0■未处理1-已处理)3.评论表(comments):字段名类型备注cidInt(ll)主键ccontentsVarchar(400)评论内容ctimeVarchar(lOO)评论吋间cstarVarchar(100)评论级别(星星)cbidInt(ll)书的idcuidInt(ll)用户idotherlVarchar(200)备用1other2Int(ll)备用2/**创建表——评论引CREATETABLEcomments(cidINT(11)AUTOJNCREMENTPRIMARYKEY,ccontentsVA
4、RCHAR(400)NOTNULL,ctimeVARCHAR(IOO)NOTNULL,cstarVARCHAR(lOO),cbidINT(11)NOTNULL,cuidINT(ll)NOTNULL,other1VARCHAR(200),other2INT(11)4.书店表(bookshop):字段名类型备注bsidInt(ll)主键bloginidvarchar(20)登录账号bpwdVarchar(40)登录密码bnameVarchar(lOO)书店名称baddressVarchar(100)书店地址bphoneVarchar
5、(lOO)联系电话bmailVarchar(lOO)书店emailbbusinesstimeVarchar(lOO)书店经营时间blawmanVarchar(lOO)法人代表other1Int(ll)备用1other2Varcahr(lOO)备用2other3Varchar(lOO)备用35.书信息表(books):字段名类型备注bidInt(ll)主键bnameVarchar(100)书名bpriceVarchar(50)价格bauthorVarchar(50)作者bdiscountfloat折扣bdiscriptionVar
6、char(400)说明bimgVarchar(200)照片路径bcategoryInt(ll)书类别bbsidInt(ll)书店主键other1Int(11)备用1other2Varchar(20)备用26.订单详细表(orderbooks)字段名类型备注obidVarcahr(lOO)主键bidInt(ll)书idonumInt(ll)数量oidVarcahr(100)订单idobstateInt(ll)处理状态(0■未处理1■已处理)obpayInt(ll)支付状态(0■未支付1•已支付)严*创建表•订单详情*/CREATE
7、TABLEorderbooks(obidVARCHAR(IOO)PRIMARYKEY,bidINT(ll)NOTNULL,onumINT(ll)DEFAULT*1oidVARCHAR(IOO)NOTNULL,obstateINT(11)DEFAULT‘0;obpayINT(ll)DEFAULTO)Sql语句:CREATEDATABASEbookShop;/**创建表——用户引CREATETABLEusers(uidINT(11)AUTO.INCREMENTPRIMARYKEY,uloginidVARCHAR(20)NOTNULL
8、,upwdVARCHAR(40)NOTNULL,unameVARCHAR(IOO)NOTNULL,uphoneVARCHAR(IOO)NOTNULL,uaddressVARCHAR(IOO)NOTNULL,umailVARCHAR(IOO),uregistert