Make our own ebay (auction system) (3)

Source: Internet
Author: User
Tags date integer table definition unique id
Based on the "information in" previous section, we have a good understanding of what we database schemas should look lik E. 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)
Increment:value to Increment proxy bids by (specified by the seller)
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)
Maxbid:maximum Price for a user
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 This bid is updated Date/time

Tblauctionusers
Uid:unique ID to keep track of records Autonumber
Name:name of User Text

Note this above tables are simply used for example. You could decide to store more information for your purposes (i.e., your 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.


Note:you can use a pre-existing user table if you wish. We simply provide the Tblauctionusers table definition for completeness sake.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.