Database Design Problems (1 Viewer)

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
I'm just heading out to play golf. Will look at this later. So what is a vehicle in
nanobody-speak?
Could we consider the
Focus 4drs Manual 4 sp Grey, 1.6 TDi, only this is a consequence/product of a "Production", with Grey, 1.6 TdI being defaults.
as the base model and you customize from there with respect to color, engine and wheels?
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
Yes, exactly,

What about So what is a vehicle in
nanobody-speak?

Can you flesh this out?
In the car analogy, you start with some materials, then in a production session you create a base model with defaults. You can then run another production with some customization/specialization to create a similar model but with different color.
If you can't do this in a Production, where and how is the color changed?

If you are Producing Models with default color and engine, what is that Produced thing called. Some aspect of the thing at the end of a Production, or a subsequent process that changes the color makes the "default" and the "colored" thing different.
Where does vehicle/car fit? It's definitely cars/vehicles that participate in races.
 

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
What about So what is a vehicle in
nanobody-speak?
Can you flesh this out?
In the car analogy, you start with some materials, then in a production session you create a base model with defaults. You can then run another production with some customization/specialization to create a similar model but with different color.
If you can't do this in a Production, where and how is the color changed?

If you are Producing Models with default color and engine, what is that Produced thing called. Some aspect of the thing at the end of a Production, or a subsequent process that changes the color makes the "default" and the "colored" thing different.
Where does vehicle/car fit? It's definitely cars/vehicles that participate in races.
A vehicle = A nanobody
A model = NanobodyFix
However a model is not produced, you only produce "Default" Vehicles based on a model, what I mean is NanobodyFix is not a physical item, but I introduced it to avoid invalid combinations.
We consider only models as part of production, because all vehicles from the same model share properties due to the production.
How and where this changes in color/engine appear are not important for this db. These are standard experiments, and are not important for the use of the nb's.
Production on the other hand is important, because it is linked to to antigen.
Knowing which models come from which production, antigen, allows us to make a "family tree" of nb's, regardless there color/engine.
 

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Hi,

http://www.idready.org/rdbms/database_RDBMS.pdf

I found this site, your pdf seems to be part of this,
I made a mission statement etc,
however the problem we had was terminology, that's why we switched to the car analogy (Although Ford was not the best choice here in Belgium now)

Anyway, I don't think the physical description of items is the problem, but putting it in a relational db design.

-Sam
 

Attachments

  • Mission Statement.doc
    31 KB · Views: 163

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
Another piece of that project: http://www.idready.org/rdbms/SARSBehindTheScenes.pdf

You can see a directory of the files involved at http://www.idready.org/rdbms/ and you can open modt of the files. However, the mdb files are not available.

---------------------------------------------

I would agree totally that the issue is related to terminology. You are dealing with subjects and processes that most of us do not understand. It is almost a jargon of your "profession".

We went to a car analogy to attempt a data model with somewhat common(easy for the guy at McDonalds) terminology; and it seemed to be working when you added additional features (races, race types..). Ford was picked out of the air - it could be any car company or any industry -even building burgers for that matter. In order to build a useful database you need to design the tables and relationships. And if an outsider (not familiar with the jargon/business) is to help in that design, the players must be able to communicate in terms they both understand. Also, the more people involved in the "help/assisting", the more difficult, but essential, is the communication.

Any articles or links that I have included in posts are/were intended to improve the concepts and steps in the design process, to clarify the database terms and/or identify approaches that have worked in various situations.

I contend that terminology is the biggest issue. Hopefully a reader or poster can identify with your "environment" and help get a data model/diagram designed and created that supports your "business facts".

Good luck with your project.
 
Last edited:

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Hello,

my comment on Ford was related to the Fact that they closed a factory here in Belgium, 10 000 people without a job ...
I know it has nothing to do withthe database design.
I'm gratefull for the help and "coursematerial" you provided,
I updated my "Mission statement",
to show you my rationale ...
Explain you where I got this Nanobody Fix table from ?
This is not a physical item, but I interpreted the normalization that way.
i included also test data, so even if you don't understand or know the terminology, you can still see the relations?

but your car db was very similar to my last Nanobody db, so i think we are on the same page.
 

Attachments

  • Mission Statement.zip
    153.9 KB · Views: 145

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Hello,
Is my mission statement clear? Is it correct to make this extra table "NanobodyFix" ?
The question now is, how do I make a form for data entry?

thanks,
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
Create some test data that makes sense to you. Make both good and bad test data.
Identify the test data as case 1, case 2....
and identify what your expectations for each case should be.
Run your test cases against your latest model.
Note any anomalies/discrepancies between the observed and expected results.

Reconcile every anomaly/discrepancy, then refine the model, or alter the test data and document the Case accordingly.

Get your data model correct before you get too deep into forms and syntax issues.

The best approach may be to get someone with similar interest/same field of work/study to participate. I'm sure it's an excellent learning opportunity.

Good luck with your project.
 

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
http://databases.about.com/od/administration/l/bldef_3nf.htm

hi,
this article describes what I think is going on?
State is dependent on Zipcode, like SpeciesReactivity, epitopeDetail, depent on name.
Name depends on his turn on Antigen and Report.

I included some test data valid and invalid.
I think they are picked up by my model with the nanobodyFixtbl,
For ease I worked with colors, even if you don't understand the terms, you can see the colors.
Things in white are free to choose from a list.

looking forward to more input,
thanks
 

Attachments

  • Book1.zip
    5.8 KB · Views: 137

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
Sam,

Please post your latest database, so I'm sure to be working with it.
What have you been doing database design/testing wise since we spoke last?
Any insights on design issues/communications issues? Do you have colleagues with similar interest to have such a database? have you bounced ideas with them?

Have you tried putting your request on a different forum?

As for your test data, you could be a little more verbose/descriptive. Just imagine some reader (the guy at McDonalds) wanting to help and seeing the spreadsheet.

What are each of the 9 things in the spreadsheet? I presume they are Productions but ...
 

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Hey,

I discussed with some colleagues, they want to store less info in the database.
So let's forget about the Production and Experiments,
I just want an overview of items( = nb's) and for what techniques they can be used.
In the exel file I listed some items, also invalid ones. (These are not Productions, but list of items).
I think to explain it to the guy in McDo, the closest analogy is Adresses, So I changed the heading of the columns into this analogy.
I included also some explanation of all the fields, and last but not least a database with the tables and relationships that according to me translates this exel into a Access db.
One new problem did arise the field Tag, actually there are 2 fields, since a tag is always a combo of 2 tags, but coming from one list.
I don't know how to cope with that exactly.

thanks
 

Attachments

  • nbs.zip
    21.1 KB · Views: 129

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
I don't see anything regarding an Address analogy.
Any way I looked at your relationship diagram.
I have attached some jpgs.
I would create the tblTagCombo as shown. I would adjust the tblNanobodies to use TagComboId as a FK to tblTagCombo. I would move Tag1 and Tag2 to the tblTagCombo as per the diagram.
I would relate the tblTag to the tblTagCombo as shown.

There are 2 instances of tblTag, just to show Tag_1_Id and Tag_2_Id are each FKs to tblTag. This is a common method to show a Table is supplying values to more than 1 field in a Table.

You will see this sort of thing with Workers and Supervisors (both are Employees).

Good luck with your project.
 

Attachments

  • TagCombo.jpg
    TagCombo.jpg
    46.5 KB · Views: 143
  • TagCombos2_NanobodiesUniqueIndex.jpg
    TagCombos2_NanobodiesUniqueIndex.jpg
    63.6 KB · Views: 136
  • TagCombos3_TagCombosUniqueIndex.jpg
    TagCombos3_TagCombosUniqueIndex.jpg
    45.9 KB · Views: 133

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Hello,

The analogy lies in the fact that when you know the ZIP Code, you automatically know the State. THis better describes my situation than a car analogy.

one question?
Why do you need indexes to prevent duplicates ? if the table has a primary key?
Does this means I need to update the 2 tables Tag 1 and 2 when there is a new tag available?
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
Why do you need indexes to prevent duplicates ?
You can use unique indexes to prevent duplicates in the non_PK fields.

if the table has a primary key? The Primary Key will not be duplicated, that's true. You won't get the same NanobodyId repeated in your tblNanobodies table(nor the tagComboId in tblTagCombo).
But what I'm trying to prevent is the same combination of NanobodyID and TagComboId in tblNanobodies.
Tag combination is unique to a Nanobody. So a unique compound index will prevent duplicates. However, based on your description "tag is always a combo of 2 tags", the unique index will prevent duplicates of tag1_tag2, but it would not consider tag2_tag1 to be a duplicate. You will have to address that in code.

Does this means I need to update the 2 tables Tag 1 and 2 when there is a new tag available?
No, there is only 1 tblTags. You add new Tags to tblTags only. tblTags is shown twice in the diagram because Tag_1_ID is resolved/gets its value from tblTags and
Tag_2_ID is resolved/gets its value from tblTags.
 
Last edited:

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
ok,
thanks.

Do you see what I mean with Adress Analogy,
why I made this Extra tblNanobodyGeneral

I found this solution in a Normalization tutorial, the Adress was an example there,
basically they said if non key attributes are dependent on each other, move them to a new table with a PK ?

that's what I got from it,
 

jdraw

Super Moderator
Staff member
Local time
Today, 15:14
Joined
Jan 23, 2006
Messages
15,379
Table design is key -- I think I've been saying that. And yes regarding Normalization - records have a unique identifier, and no functional dependency of non key fields on each other.

Here's a good write up from Jerry Dennison - makes a good reference document.

First Normal Form:
Every table should have a Key <---- this means that each record must be uniquely identified
All ATTRIBUTES must be atomic <----- this means that there should be no repeating groups within a field (i.e. multiple values within a field separated by a comma or other delimiter) Strictly speaking, this phrase has nothing to do with repeating groups of fields or tables, that is actually covered (however esoterically) by other Forms. BUT, I tend to expand the meaning of this Form to include repeating groups wherever they may be found.

Second Normal Form:
Must be in First Normal Form <---- the forms are heiarchical, each is dependent on the one before it
A RELATION is in second normal form if each ATTRIBUTE is fully functionally dependent on the ENTIRE primary key <---- this means that no subset of the key can determine an attribute's value

Third Normal Form:
Must be in Second Normal Form
A RELATION is in third normal form when no non-key attribute is dependent on any other non-key attribute <---- this and 2NF are the primary Forms that prohibits the storage of calculated values or transitive dependencies.

BCNF
Must be in Third Normal Form
All candidate keys must satisfy the test for third normal form <---- a candidate key is of itself a potential unique identifier of the entity, generally speaking candidate keys are mutli-field constructs. This does not mean you should use a candidate key as the PK, it means that it could satisfy the requirements of uniqueness. For most entities, there are many candidate keys.

Fourth Normal Form
Must be in 3NF/BCNF
There can be no nontrivial multivalued dependencies in a relation <---- This is a fairly common reduction that most people achieve without even knowing it. This form prohibits independent multivalued components of the key. For example, if an employee can have many skills and many dependents you would move the skills and dependents to separate tables as they are not related in any way.

Fifth Normal Form
Must be in Fourth Normal Form
This is Nervana of DB design and is seldom reached. Basically, it advocates that you continue splitting the structure down until either of two states exist: that you've split so far that the resulting tables could not be joined to reconstruct the original, OR further splitting would be trivial.

Natually, this doesn't even come close to really describing what you're trying to accomplish. There are also definitions that need to be understood, specifically around what an entity is, what an attribute is, what a relation is, functional dependency (a tough one, the formal definiton of Functional Dependence is: For any relation R, attribute A is fully functionally dependent on attribute B if, for every valid instance, the value of B determines the value of A.), then of course there's multivalued dependency, trivial dependency, and last but not least candidate key.

Now, to boil all of this down to something usable. You must ask yourself the following:

Am I repeating groups? These can be multiple values in a single field, repeated TYPES of fields that share the same datatype and a common root name or root structure (these are the multiple date fields in Drew's db), or repeating tables of the same entity type (these can be noticed because they generally have the same fields but in different tables).

Am I trying to store derived or calculated values? (we should all know by now not to store calculated values)

Do I have multiple tables with more than one index based on multiple fields? (this usually indicates combining of entities, remember: an table is an entity and an entity a table)

Do I have a large number of values being repeated in a column (field)? This does not include FK's linked to another table's PK. It does include just about anything else. If you find that you're repeating a lot of values then you MAY need to move this to it's own table. This particular question is lowest in priority.
 

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Ok,

From the questions you have to ask yourself (from my test data) :

Indeed I have values repeated in a column, that's why we split it up in multiple tables with a PK related to tblNanobodies with the FK.

Indeed I have items that share the same root ( this is a nice way of putting it) record 1 and 3 share the same root in my exel table, the colored fields.

what's the solution for this in db design?
My solution based on what I could find online and thanks to your material,
split the root from the table into a new table?
tblNanobodyGeneral being the root

my question is this the way to go of am I misinterpreting the theory?
 

SamLis

Registered User.
Local time
Today, 12:14
Joined
Sep 29, 2012
Messages
53
Hello,

I worked and searched tutorials, this is what I end up with.
2 questions :

1) My SearchForm, I want to filter my records based on comboboxes : like Technique, EpitopeGeneral and Epitope Detail?
2) I changed my multivalued field Species Reactivity to a junction table (recommendation on another forum), is there a way to show the multiple values in one field in a form or query?

Since I'm a newbie, I don't know if what I did is according to convention, any remarks /suggestions are welcome.
I you think that this setup will get me into trouble later, let me know ...


thanks
 

Attachments

  • Nanobodies6.zip
    183.4 KB · Views: 128
Last edited:

Users who are viewing this thread

Top Bottom