Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7873241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T02:27:13+00:00 2026-06-03T02:27:13+00:00

I am stumbling when it comes to how to deal with a database design.

  • 0

I am stumbling when it comes to how to deal with a database design. I have looked around and found examples like http://www.tomjewett.com/dbdesign/dbdesign.php?page=manymany.php which would work quite well for a shop selling items but I want to build a database that would track sales (or trades) between two users.

Ex John trades cards x1, x2, x3, x4 for Jane’s (4 * y1), y2, and $5.00. (In this example John trades four cards, named x1, x2, x3, x4 for 5 of Jane’s cards, 4 of a card named y1, 1 named y2 and $5.00.)

I would also want Jane to be able counter offer to John for extra cards, or whatever she might want to balance it out in her mind.

Thank you in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T02:27:15+00:00Added an answer on June 3, 2026 at 2:27 am

    This is an interesting example of a relational DB design. Essentially, my recommendation would be to create a structure that is as normalized as possible. That means basically that you want to create tables such that you can fill in the blank: “a row in this table represents a unique __.”

    For your particular application, I would suggest:

    • A table of users, 1 row per user
    • A table of cards, 1 row per each card (regardless of how many instances of that card exist in the world – an example would be a row for a 1984 Michael Jordan rookie card by Topps)
    • A table of trades, 1 row per trade. You would want the trade row to contain columns for the user1 and user2 involved in the trade, using their IDs from the users table. If you want the ability to counteroffer, I would suggest that a counteroffer is just another row in this table, with a column “original_offer” that references the offer on which a counter-offer is based.
    • A table of trade items. Here, you would have 1 row for each item involved in a trade, with the quantity. Each row would have a tradeID that maps to the trades table, a cardID that maps to the cards table, a quantity column, and “from” and “to” columns, each of which map to the userIDs involved.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with System.Func but have reached a stumbling block with it. System.Func<TReturn>
Maybe its because I've been coding around two semesters now, but the major stumbling
I'm currently working on a project Euler problem (www.projecteuler.net) for fun but have hit
Consider a database(MSSQL 2005) that consists of 100+ tables which have primary keys defined
We have a bit of an odd setup, which comes from the fact we
I am using php to pull information out of a database, but I have
I have been stumbling over this problem for a while now. I am trying
I'm not a JS guy so I'm kinda stumbling around in the dark. Basically,
We are considering a move from SVN to Mercurial, and have encountered a stumbling
I'm working through the O'Reilly Programming Scala book, and have run into a stumbling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.