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 6612831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:08:42+00:00 2026-05-25T20:08:42+00:00

I would like to create a database for MTG cards I own. What would

  • 0

I would like to create a database for MTG cards I own. What would the design be?
I would like to store the following information about each card:

1. Name of card.
2. Set the card belongs to.
3. Condition of card.
4. Price it sold for.
5. Price I bought it for.

Here is a little info about MTG cards in general:

1. Every card has a name. 
2. Every card belongs to a set.
3. A card may have a foil version of itself. 
4. Card name, set it belongs to, and whether it's foil or not makes it unique. 
5. A card may be in multiple sets.
6. A set has multiple cards. 

The gimmick is that in my collection I may have several copies of the same card but with different conditions, or purchased price, or sold price may be different.

I will have another collection of mtg cards that have been sold on eBay. This collection will have the price/condition/date/whether it was a “Buy It Now” or Bid, etc.

The idea is to find out what price I should sell my cards based on the eBay collection.

  • 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-05-25T20:08:43+00:00Added an answer on May 25, 2026 at 8:08 pm

    It’s not a programming question, it’s a modeling question. Anyone who is programming but not modeling, is a coder, not a programmer. That’s just a step above data entry. Modeling is a fundamental aspect of programming as it deals directly with abstraction, and abstraction is the real genius of computer programming.

    Normalization and database design is an excellent way for someone to become better at programming in general as normalization is also an abstraction process.

    Abstraction is arguably the most difficult aspect of computer programming, particularly since computer programming requires a person to both be especially pedantic and literal (in order to properly work with the steadfast stubbornness and idiocy that is a computer) as well as handle and work in a very high level and abstract space.

    For example, the arguments in design meetings are not over language syntax.

    So, that said. I have updated the schema in minor ways to address the changes.

    create table card (
        card_key numeric not null primary key,
        name varchar(256) not null,
        foil varchar(1) not null); -- "Y" if it's foil, "N" if it is not.
    
    create table set (
        set_key numeric not null primary key,
        name varchar(256) not null);
    
    create table cardset (
        card_key numeric not null references card(card_key),
        set_key numeric not null references set(set_key));
    
    create table condition (
        condition_key numeric not null primary key,
        alias varchar(64),
        description varchar(256));
    
    create table saletype (
        saletype_key numeric not null primary key,
        alias varchar(64),
        description varchar(256));
    
    create table singlecard (
        singlecard_key numeric not null primary key,
        card_key numeric not null references card(card_key),
        condition_key numeric not  null references condition(condition_key),
        purchase_date date,
        purchase_price numeric,
        saletype_key numeric references saletype(saletype_key),
        sell_date date,
        sell_price numeric,
        notes varchar(4000));
    

    A more detailed explanation.

    The card table is the concept of the card vs an actual card. You can have a card row without having any actual cards in hand. It models any details of the card that are common to all cards. Obviously MTG cards have very many details (color text as some one mentioned), but these are likely not important to this kind of model, since this is to track actual cards for the sake of collecting and sale. But if there was any desire to add any other attributes, like card rarity, the ‘card’ table would be the place to put them.

    The set table is for the sets. I don’t know what a set is, only what is posited here (there is also casual reference to a series, I don’t know if they are related or not). Sets have a name, and are used to group cards. So, we have a ‘set’ table.

    The cardset table is the many-to-many joiner table. Since a set can have several cards, and a card can belong to several sets, the model needs something to represent that relationship. This is a very common pattern in relational databases, but it is also non-obvious to novices.

    There are two simple lookup tables, the condition and saletype table. These two tables are here for normalization purposes and let the user standardize their terms for these two categories of data. They each have an ‘alias’ and a ‘description’. The alias is the short english version: ‘Good’, ‘Poor’, ‘Auction’, ‘Buy it now’, while the description is the longer english text ‘Poor cards show sign of wear, bending, and rub marks’. Obviously someone doing this for their own purpose likely do not need the description, but it’s there as a habit.

    Finally, the meat of the system is the singlecard table. The singlecard table represents an actual, in your hand card. It models all of the characteristic that make each actual card different from each other. An individual card is not a member of a set (at least not from the description), rather that’s a higher level concept (such as how it was published — all “Hero: Bartek the Axe Wielder” cards are part of the “Dark Mysteries” and “Clowns of Death” sets, or whatever). So, the single card needs only reference its parent card table, with the actual common card characteristics.

    This single card has the references to the card’s condition and how it was sold via the foreign keys to the appropriate tables. It also has the other data, such as the dates and prices that were necessary.

    Based on what was given, this should meet the basic need.

    It would be a good exercise to remodel this yourself. Start with the your most basic needs, and the best model that you understand to make. Then contrast it to what I’ve written here, and then use that book to perhaps try and understand how whatever your simple design may have been becomes this design.

    Note that there is no way to actually enforce that a card is a member of ANY set, or that a set has any cards. That will be an application logic problem. This is the one of this issues with many-to-many joiner tables. It can model the relationship, but it can not enforce it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to create a database for each customer. But before, I would
I am a beginner at database design and I would like to create a
I would like to create a database backed interactive AJAX webapp which has a
I would like to create my database tables in SMS then generate a script
I would like to create a copy of a database with approximately 40 InnoDB
I would like to create the ASP.NET User database template on a database of
We would like to use a cronjob to create a database backup. The backup
I'm using a MSSQL database and would like to create a column that only
I have a SQL2005 Express database that I would like to create a copy
I would like create my own collection that has all the attributes of python

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.