欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

制作我们自己的Ebay(拍卖系统)(3)

程序员文章站 2022-06-16 15:12:20
based on the information in the previous section, we have a good understanding of what our database...
based on the information in the previous section, we have a good understanding of what our database schema should look like. the following tables list our database structure:

tblauctions
aid:unique id to keep track of records autonumber
startdate:date the auction started date/time
enddate:date the auction is to end date/time
sellerid:the id of the seller. (foreign key to user table) integer

tblauctionitems
iid:unique id to keep track of records autonumber
aid:which auction does this item belong to? (foreign key to auctions table) integer
name: name of the item being sold text
description: description of the item being sold text
minprice: minimum price to sell (specified by the seller) money
increment: value to increment proxy bids by (specified by the seller) money
available: number of items available to sell integer

tblauctionbids
bid: unique id to keep track of records autonumber
iid: unique id to keep track of items (foreign key to auctionitem table) integer
uid: unique id to keep track of bidders (foreign key to auctionusers table) integer
winprice :current price for a user (calculated by application) money
maxbid: maximum price for a user money
biditems :the number of items this user bid for integer
winitems: the number of items this user would win if the auction ended immediately integer
time: the last time this bid was updated date/time   

tblauctionusers
uid :unique id to keep track of records autonumber
name :name of user text

note that the above tables are simply used for example. you may decide to store more information for your purposes (i.e., you may store more than just a name in the user table). already, however, the schema is getting kind of complex - each table has foreign keys to one or more other tables.


note: you can use a pre-existing user table if you wish. we simply provide the tblauctionusers table definition for completeness sake.