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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:31:23+00:00 2026-05-24T02:31:23+00:00

I’m beginning to build a stamp collecting web app. Python/flask backend (i think :))

  • 0

I’m beginning to build a stamp collecting web app. Python/flask backend (i think :)) mySQL as db. I don’t know much about db design so please keep that in mind if I do some really stupid mistake in the way I thought it out. I was thinking of splitting the data into 3 tables.

  • users table (all the users should be added upon registration to this table)
  • stamps table (all stamps should reside here and only modified by me)
  • owned table (junction table with user_id and stamp_id as foreign keys)

Question : if I put user_id and stamp_id as primary key , there will only be one unique entry of this type for example user_1 has card_1. But user_1 might have a duplicate of card_1 so i should have 2 rows
user_1 card_1
user_1 card_1
Another problem that arises is that I want to include state of owned stamp. For example user_1 might have a card_1 in mint condition and a card_1 in bad condition. As far as I understand I can only enter one unique pair of user_1 card_1 . What can I do to get the desired result? Also if there’s a better way of doing this please let me know.

Aditional question. I was using mysql workbench to try to plot the db so I have a question about the sql it generates. the CONSTRAINT “fk_gibberish”, is that normal or … why is that ?

CREATE  TABLE IF NOT EXISTS `stampcollect`.`users` (
  `user_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  `user_username` VARCHAR(45) NULL ,
  `user_password` VARCHAR(45) NULL ,
  `user_email` VARCHAR(45) NULL ,
  PRIMARY KEY (`user_id`) )

CREATE  TABLE IF NOT EXISTS `stampcollect`.`stamps` (
  `stamp_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,
  `stamp_name` VARCHAR(45) NULL ,
  PRIMARY KEY (`stamp_id`) )

CREATE  TABLE IF NOT EXISTS `stampcollect`.`owned` (
  `user_id` INT NOT NULL ,
  `stamp_id` INT NOT NULL ,
  `stamp_status` BIT NULL ,
  PRIMARY KEY (`user_id`, `stamp_id`) ,
  INDEX `fk_{F5DBEF0D-24E0-4AFF-A5CB-2A6A0D448C96}` (`stamp_id` ASC) ,
  CONSTRAINT `fk_{22B4468E-A5FB-4702-A8A9-576AA48A0543}`
    FOREIGN KEY (`user_id` )
    REFERENCES `stampcollect`.`users` (`user_id` ),
  CONSTRAINT `fk_{F5DBEF0D-24E0-4AFF-A5CB-2A6A0D448C96}`
    FOREIGN KEY (`stamp_id` )
    REFERENCES `stampcollect`.`stamps` (`stamp_id` ));
  • 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-24T02:31:25+00:00Added an answer on May 24, 2026 at 2:31 am

    If users can own the same stamp in multiple states then the state should go in the “owned” table and be part of the key. If he can own multiple copies of the same stamp then it would make sense to have a “quantity” column in that table (not part of the key).

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a text area in my form which accepts all possible characters from
I'm parsing an XML file, the creators of it stuck in a bunch social

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.