0

I'm working on a new database schema.
I'm working on a program to register playing cards into a card collection.
That needs to take into account many different factors.
The bit I have the most trouble with is how to handle several different editions of a particular card. +---------------------+ | Kort info | +-----------+---------+ | kort navn | kort ID | +-----------+---------+ | Clubs | 1 | +-----------+---------+ | Diamonds | 2 | +-----------+---------+ | Hearts | 3 | +-----------+---------+ | Hearts | 4 | +-----------+---------+

Playing cards in a collection usually appear like this +---------+-----------+----------+----------+----------+---------+ | Kort ID | kort navn | antall a | antall b | antall c | antal d | +---------+-----------+----------+----------+----------+---------+ | 1 | Clubs | 1 | | | | +---------+-----------+----------+----------+----------+---------+ | 2 | Diamonds | 2 | 3 | | | +---------+-----------+----------+----------+----------+---------+ | 3 | Hearts | | | 4 | | +---------+-----------+----------+----------+----------+---------+ | 4 | Spades | | | | 13 | +---------+-----------+----------+----------+----------+---------+

Each card comes in several editions. And which edition exists are listed in the table "legal cards".
+------------------------+ | legal cards | +---------+--------------+ | kort ID | eksisterende | +---------+--------------+ | 1 | a | +---------+--------------+ | 1 | b | +---------+--------------+ | 1 | c | +---------+--------------+ | 2 | a | +---------+--------------+ | 2 | b | +---------+--------------+ | 3 | b | +---------+--------------+ | 3 | c | +---------+--------------+ | 4 | d | +---------+--------------+

The number of cards with edition is stored in the table "cards in stock". +----------------------------+ | cards in stock | +---------+---------+--------+ | kort ID | versjon | antall | +---------+---------+--------+ | 1 | a | 1 | +---------+---------+--------+ | 2 | a | 2 | +---------+---------+--------+ | 2 | b | 3 | +---------+---------+--------+ | 3 | c | 4 | +---------+---------+--------+ | 4 | d | 13 | +---------+---------+--------+



What I mainly want to ask is this the best solution?

Or is there a better solution I should use?
Or are there certain things in my solution I should look out for?

list of names of cards

list of cards in a collection

list of legal cards in a collection

common way to show results

Virus0056
  • 1
  • 2
  • 1
    Please [use text, not images/links, for text--including tables & ERDs](https://meta.stackoverflow.com/q/285551/3404097). Paraphrase or quote from other text. Give just what you need & relate it to your problem. Use images only for what cannot be expressed as text or to augment text. Images cannot be searched for or cut & pasted. Include a legend/key & explanation with an image. Also, links die. Insert images/links using edit functions. Make your post self-contained. – philipxy Nov 20 '19 at 22:47
  • Thanks for the tip - updated. Looks like I'm not allowed to post pictures yet. And I'm looking into inheritance. – Virus0056 Nov 21 '19 at 08:44
  • It's not a matter of "yet". Don't post an image or link for content that can be given in text. – philipxy Nov 21 '19 at 09:48

0 Answers0