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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:48:42+00:00 2026-05-26T14:48:42+00:00

I’m trying to come up with a relational model and database implementation, but keep

  • 0

I’m trying to come up with a relational model and database implementation, but keep running into this problem. But I don’t even know what to call it! Suggestions for improving the title would be appreciated.

I’ve tried to boil the problem down to its basics.


Simplified example:

Here’s the MySQLWorkbench diagram:

MySQLWorkbench data model


As you can see, the problems are all with the Atom table.

Outline of desired goal:

  • I need to store data for specific atoms of proteins
  • I may have data for some of the atoms, or none of the atoms
  • I don’t want to be able to insert junk data — I’d like for the database constraints to prevent this

What I’m not sure about:

  • whether there should be an Atom table — it seems like a join between Atom_ref and Residue would generate all the atoms of the protein — but I also need to store data about the atoms

Outline of problem:

  • each atom needs a residue, and an atom_ref
  • but since the residue is associated with a residue_ref, the atom_ref can only be one of the associated (with the residue_ref) atom_ref’s
  • don’t know how to match the residue_ref of the Residue with the residue_ref of the atom_ref

What I’ve tried so far:

  • add the pk of Atom_ref to the pk of Atom — but then the residue_ref might not match that of Residue
  • change Residue.rr_name to part of the pk — violates domain semantics

I know this is a poor explanation of the problem, I’m trying to figure out how to explain it more clearly! Suggestions for improvement are more than welcome!

  • 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-26T14:48:43+00:00Added an answer on May 26, 2026 at 2:48 pm

    If I understand you correctly, then what you’re after is an inclusion dependency between (a) the join of Atom and Residue, and (b) Atom_ref. (i.e. all atomnames in Atom, combined with the rr_name defined for it in residue, must be declared as being valid combinations, i.e. must appear in Atomref).

    The way to do it using merely RI/FK, is to include rr_name in Atom, redundantly. Extend the FK from Atom to Residue to all three columns. This will guarantee you that the rr_names recorded in Atom remain consistent with the information in Residue. But since you have now introduced rr_name in Atom, you now have the means to ensure (through an FK atomname+rrname from Atom to Atom_ref) that whatever is recorded in Atom, is also consistent with the atomnames which have been declared (In atomref) to exist for the residueref involved.

    Note that this “solution” makes updating your database harder (more redundancy to maintain, giving rise to more potential for violations), because you have just lowered the NF level of your design.

    The other way to do it is to leave your design as is, and enforce the constraint through appropriate triggers on every involved table where an update could cause a violation of your business rule. That would be, deletes and updates on Atom_ref (i.e. anything that causes the disappearing of a valid combination that effectively exists somewhere), updates (of rr_name) on Residue, and inserts and updates on Atom (i.e. anything that might cause the appearance of some combination that might not be valid).

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I want to count how many characters a certain string has in PHP, but

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.