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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:27:39+00:00 2026-05-15T21:27:39+00:00

I have a database that has two tables, these tables look like this codes

  • 0

I have a database that has two tables, these tables look like this

codes
id | code | member_id
1  | 123  | 2
2  | 234  | 1
3  | 345  |  
4  | 456  | 3

members
id | code_id | other info
1  | 2       | blabla
2  | 1       | blabla
3  | 4       | blabla

the basic idea is that if a code is taken then its member id field is filled in, however this is creating a circle link (members points to codes, codes points to members) is there a different way of doing this? is this actually a bad thing?


Update
To answer your questions there are three different code tables with approx 3.5 million codes each, each table is searched depending on different criteria, if the member_id column is empty then the code is unclaimed, else, the code is claimed, this is done so that when we are searching the database we do not need to include another table to tell if it it claimed.

the members table contains the claimants for every single code, so all 10.5 million members
the additional info has things like mobile, flybuys.

the mobile is how we identify the member, but each entry is considered a different member.

  • 1 1 Answer
  • 2 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-15T21:27:39+00:00Added an answer on May 15, 2026 at 9:27 pm

    It’s a bad thing because you can end up with anomalies. For example:

    codes
    id | code | member_id
    1  | 123  | 2
    
    members
    id | code_id | other info
    2  | 4       | blabla
    

    See the anomaly? Code 1 references its corresponding member, but that member doesn’t reference the same code in return. The problem with anomalies is you can’t tell which one is the correct, intended reference and which one is a mistake.

    Eliminating redundant columns reduces the chance for anomalies. This is a simple process that follows a few very well defined rules, called rules of normalization.

    In your example, I would drop the codes.member_id column. I infer that a member must reference a code, but a code does not necessarily reference a member. So I would make members.code_id reference codes.id. But it could go the other way; you don’t give enough information for the reader to be sure (as @OMG Ponies commented).

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

Sidebar

Related Questions

I have a database that has two tables, one of which contains a foreign
I have a database with two tables: Users and Categories . Users has these
I have a Play Framework (1.2.4) project with PlayMorphia that has two different database
I have a database that has 16 tables, but only four are relevant to
I have a database that has node & nodetype tables. Nodes table NodeID ParentNodeID
I have a SQL Server 2008 database. This database has a stored procedure that
I have a database structure that has two one-to-many relationships. I have a website,
I have two databases on one machine that also has two different sites running
I have a database that has around 10k records and some of them contain
I have a database that has a table email_eml that stores 3 attributes name_eml,

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.