<CDMAPoster@FortuneJames.com> wrote in message
news:1135735646.901046.235860@g49g2000cwa.googlegr oups.com...[color=blue]
> MP wrote:[color=green]
> > context: vb6/ado/.mdb/jet 4.0 (no access)/sql[/color][/color]
Hi James,
First, thank you for looking at this.
Second, I'm not sure I communicated clearly and/or I'm not sure I'm
understanding clearly the following layout.
(as far as me not having step1 figured out before going to step2...that's
par for the course <vbg>)
I wasn't thinking of them as step wise items, but just an overview of the
different kinds of information I need to deal with.
At this point in my thinking I realize I'm not clear on the final shape of
all the tables....
What I see is that I have a few "separate" issues on which I'm not clear
(well, more than a few probably <vbg>)
(and which are (in my mind) not necessarily step wise dependent on one
another - but maybe they are...that's where my inexperience with databases
may be hampering my understanding of your layout)
....maybe my original post was confusing in this regard
:-)
As I understand your reply, you're looking at tblFamily seems to be the
"Main" repository..with pointers to subtype etc
For some reason I'm looking at tblComponent as being the "main" repository
.... with Family just being a small piece of data about Component.
I see the following 4 points as being Cardinal questions in my problem
domain.
1) whether to store information about every job for every year in one giant
db for the entire company (which would keep getting bigger every job every
year and I would think degrading performance over time...but I'm not
experienced enough in databases to know if that's true)
- or -
to store information which is CompanyWide (list of clients, list of
jobs, etc) in one "master.mdb"
and then to store job specific information about each individual job in
it's own "Job.mdb"
considerations:
- once a job is done there is only a rare occasion that I may have to go
back to a past job looking for information
- once a job is one or two years old it's almost inconceivable we would
need access to that information other than in the sense of archival storage
in the event of some liability question years down the line(and that's
highly unlikely)
- there is no relation ship from job1 to job2 in terms of the data
stored for that job(in the sense of "component data")
(other than the company wide information like list of clients etc,
which does make sense to store in companywide database)
- we, at the present time, have no questions we ask which compare one
job to another...they are very much stand alone projects
(although I do understand that could evolve as we learn more about
the power of databases...assuming I keep my job that long<vbg>)
2) how to store information about a general class of object"Component" which
may be one of three different subtypes
considerations:
- some data will be the same for every subtype and some will be
different for each subtype
(that's why I thought (based on my limited studies of database
theory) that a heirarchical relationship existed)
(but I have no idea how to *implement* that heirarchical
relationship in database terms - I was just imagining it would be a "common"
table and 3 "sub" tables)
I'm fine with your suggestion to *not* make it heirarchical...I just
don't know what the alternative is...
I can easily accept the answer that I just need three different tables
one for each type and forget the one "universal" table
and just accept that the three tables will have some fields which repeat
from one to the next...I guess that's not really duplicating data (in the
sense of normalization to prevent duplcation of data)
Its' just duplication of *dataFields* not duplication of *dataValues*
so maybe that's ok...
(actually there is probably much more information that is different from
one type to another so maybe the commonComponent table is really a waste of
resources)
3) How to store "family" information
considerations:
- FamilyName "A" has no intrinsic meaning...it is an arbitrary selection
from a list of "legal" selections relative only to a given job.
- once the familyName "A" is assigned for Job 12345, it will then be
related to some information, like shape, volume, weightperinch etc on a job
by job basis
- for job# 12344, family "A" has no relationship to family "A" for job#
12345
- family "P" for subtypeOne has no relationship at all to family "P" for
subtypeTwo on the same job number 12345
(assuming that family"P" is a legal familyname for both subtypes for
a given (job/client))
- the family names are originated on the fly as a job progresses,
I find one kind of piece, I name it "A"(or whatever the actual
designation becomes...which also varies by Client...based on their
various standards for naming convention of their pieces)
then I find the next piece, I name it "B" etc...
maybe job 12344 has only A-C but job 12345 has A-Z
(so the possible list of legal family names may also have to be stored
in a table somewhere with a fldClientId pointing to a table of clients
then in the table of clients there may be a pointer to the table of
possible family names)
Like I said I'm not sure how all this wants to look in it's final form.
4) How to store "feature" information - (the original "partial" question)
Part of my problem lies in the fact that I'm not experienced in databases so
my thinking does not automatically arrange itself in appropriate units in
all probability
My thinking is arranged around the real world units (Components) with which
I am dealing.
As such the "base" unit is Component.
The Features discussed below are a fact about a Component.
However the table structure is arranged and however the queries need to be
written, each Component needs one entry in some table(or Tables) which
completely describes that one component. Since there are 3 subtypes of
components my thinking was that I would have to pull information from at
least two tables (commontable, subtypetable) to get a full view of one
component. (see my post @ 12/27/05 1:47pm yesterday about the heirarchical
nature of my objects)
The "Features" described below only apply to one or possibly two of the (3)
SubTypes of Component.
One of the facts about that one component is what do it's two ends look like
(granted there are two ends but there is only one component)
so the combined facts about Left end condition and Right end condition
devolve into (somehow) One fact about One component.
[color=blue]
>To give you an idea of what I'm
> looking at, think of La1Ra looking more like:
>[/color]
----------------------------------------------------------------------------
-[color=blue]
> tblFeatures[/color]
Yes
--------------------------------[color=blue]
> fldFID PK[/color]
Yes, meaningless Unique Long or GUID Key
--------------------------------[color=blue]
> fldFeatureGroupID Long[/color]
not sure what fldFeatureGroupID is
it looks like it would be a FK to a tblFeatureGroup PK fldFeatureGroupID
I'm not clear how you're using FeatureGroup here...
I think the fldFeatureCondition you have below is what I'm calling Feature
Maybe FeatureGroup and FeatureCondition are one and the same thing?
--------------------------------[color=blue]
> fldJobID Long[/color]
In my original schema I was considering using a separate .mdb file for each
job we do.
We store all files re a given job in a "job folder" on the server.
It made sense to me to store a .mdb file there as well.
However, when asking about the merits of PerJob or PerCompany .mdb
philosophy I was recommended to use PerCompany.
That to me complicates the layout of the .mdb, making it a huge database
storing all information about all jobs we do.
But since that was what was recommended, that is the direction I'm trying to
go.
The reason I mention the Job question is that you have fldJobID in
tblFeatures.
I thought fldJobId would be in tblComponent.
In other words, a JobId is a fact about a component, and a feature is also a
fact about a component, but a JobId is not really a fact about a Feature.(at
least in my mind) perhaps you can comment on that relationship in your
schema below.
In my understanding to get information about a job, I would filter
tblComponent on fldJobID, then filter that result on whatever other criteria
applied for the specific query.
--------------------------------[color=blue]
> fldEndDesc Text[/color]
this would imply I would need two records for each Component, one whose
fldEndDesc = "L" and another for fldEndDesc = "R"
what about if I had two fields...fldEndLeft and fldEndRight...wouldn't that
allow me to have only one record per piece?
(and again, I think these fields would be in tblComponent or
tblComponentSubTypeOne but not in tblFeature)
--------------------------------[color=blue]
> fldConditionID Long[/color]
--------------------------------[color=blue]
> fldVariationNumber Long
>
> 10 3 13244 L 1 1
> 11 3 13244 R 1 Null
>
> given:
> tblConditions
> fldConditionID fldCondition
> 1 a
> 2 b
> 3 c[/color]
[color=blue]
>
> Then a query looking for fldJobID = 13244 grouped by fldFeatureGroupID
> where fldFeatureGroupID = 3 will produce La1Ra (subquery details
> eventually).[/color]
While my queries will always be filtered for just one job at a time, I think
of the primary object to query is Component
So I think of the query as (pseudo sql)<g>
Select "allComponents" where fldJobId = "currentJob"
Now I have all components for Job 13244
Now from those components I have to sort them by "FeatureSet"
Select "allComponents" from "PreviousSet" Where fldFeatureLeft = "A" And
fldFeatureRight = "A"
Now I have all components whose leftEnd = a and whose Right end = a
Now I can sort Those Components by Length...
Two more lines in tblFeatures would specify an additional[color=blue]
> feature. This is just a small example of where I'm going since this
> idea needs to be checked against your entire schema.[/color]
I'm not understanding some things here...:-(
hopefully (if I haven't worn out my welcome already <g>) some further
conversation will clarify
It's too bad that[color=blue]
> you're locked in to your 'hard-coded' initial set of sorted length
> values. That's a nasty angle. I'll continue to keep working on this
> schema and I'll probably have more questions concerning it. A bonus
> for me is that my main employer deals with specifications for right and
> left-hand manufactured components.[/color]
I think somewhere in the following is where I'm not understanding exactly
how you're dividing up the information
I'm sure you're correct in your assesment...I'm just not "getting" it yet...
I'll keep working on it and maybe if you respond to my responses you can
help me understand why this scenario is better than how I'm thinking of
having different tables for each subtype
In the meantime, given the hint of[color=blue]
> where I'm headed, try to extend this idea, if possible, to having a
> fldFamilyID with a fldFamilyName represent the hundreds of possible
> families. fldShape can be one of the fields in tblFamilies along with
> a field used to designate R or L. One of the beauties of all this is
> that you don't need fldCompSubTypeUniqueValueTable. Any family table
> containing fldCompSubTypeID as a foreign key will have data that
> connects. No downward pointers are required. In fact, if
> fldCompSubTypeID is a foreign key in tblFamilies then all the families
> (including names) for all the subtypes can be contained in that single
> table and fldCompSubTypeID together with fldSubTypeFamilyNumber can be
> used to look up the family information relative to a specific subtype.
> I.e., each table of components of a given type join tblComponent on
> fldComponentSubTypeID and fldFamilyNumber with a different set of
> fields available, including all the common ones. In that case
> tblFamilies would be a static table used to look up that information
> and fldFamilyNumber could be included in tblComponent knowing that
> enough information is present to get the family information. Let me
> know what you think of that idea. Let's not delve into hierarchic OO
> database design unless we need its strengths. So what we're looking at
> so far is:
>[/color]
----------------------------------------------------------------------------
-[color=blue]
> tblConditions[/color]
not sure where you're going with this one...is this the variations per given
feature? like La1 versus La ?[color=blue]
> fldConditionID PK
> fldCondition Text[/color]
----------------------------------------------------------------------------
-[color=blue]
> tblFeatures[/color]
I'm still not clear on this one...see comments above[color=blue]
> fldFID PK[/color]
Yes, meaningless Unique Long or GUID Key[color=blue]
> fldFeatureGroupID Long
> fldJobID Long
> fldEndDesc Text
> fldConditionID Long
> fldVariationNumber Long
> ...
>[/color]
----------------------------------------------------------------------------
-[color=blue]
> tblJob[/color]
Yes[color=blue]
> fldJobID PK[/color]
Yes[color=blue]
> fldJobNumber Long[/color]
Yes[color=blue]
> fldJobName Text[/color]
Yes[color=blue]
> fldClientID Long[/color]
Yes[color=blue]
> ...[/color]
----------------------------------------------------------------------------
-[color=blue]
> tblClient[/color]
Yes[color=blue]
> fldClientID PK[/color]
Yes[color=blue]
> fldClientName Text[/color]
Yes[color=blue]
> fldClientAddress Text[/color]
Yes[color=blue]
> fldClientCity Text[/color]
Yes
----------------------------------------------------------------------------
-[color=blue]
> tblClientStandards[/color]
Yes[color=blue]
> CSID PK[/color]
Yes[color=blue]
> fldClientID FK[/color]
Yes[color=blue]
> fldStandardName Text[/color]
Yes
----------------------------------------------------------------------------
-[color=blue]
> tblComponent[/color]
Yes, I see the need for a table of components (this holds all data which is
common to all component sub-types (in my thinking)...if that's correct?)
This is in my thinking the "Main"/"Master" (whatever) table in the whole
database....all other tables exist to clarify the data about this component
--------------------------------[color=blue]
> fldComponentID PK[/color]
Yes
--------------------------------[color=blue]
> fldJobID FK[/color]
Yes
--------------------------------[color=blue]
> fldComponentSubTypeID FK[/color]
Yes
--------------------------------[color=blue]
> fldFamilyNumber FK[/color]
not sure but wouldn't this be fldFamilyID from tblFamilies below?
--------------------------------[color=blue]
> fldComponentName Text[/color]
yes, this is the final name derived/calculated/stored data after all
components are entered/sorted/and named
--------------------------------[color=blue]
> fldComponentLength Double[/color]
Yes
--------------------------------[color=blue]
> fldComponentUnits Text[/color]
Not sure what this one is...is it a description of what units the length
value above is measured in??? eg("feet" or "inches" or "meters" etc)??? if
so that's a good idea which I had not considered...we usually would measure
it in inches but that 's good to make it a mutable field for future
growth/adaptation
[color=blue]
>[/color]
----------------------------------------------------------------------------
-[color=blue]
> tblComponentSubType[/color]
Yes, I see the need for a table separating the 3 subtypes of components
--------------------------------[color=blue]
> fldCompSubTypeID PK[/color]
Yes
--------------------------------[color=blue]
> fldCompSubTypeName Text[/color]
Yes
(this table would - at current point - have 3 entries "Precast" "CastStone"
"Hardware")
does this relate to my other post @ 12/27/05 1:47pm yesterday about the
heirarchical nature of my objects?
ie base object = Component
sub object = ComponentSubType
(one of the subobjects is Hardware...which also has subtypes
(HardwareStruct, HardwarePanel, HardwareLoose)
----------------------------------------------------------------------------
-[color=blue]
> tblFamilies[/color]
----yes I see the need for tblFamilies (but it may vary per client and per
job)
this table holds the "legal" family names
this has to relate back to tblClient somehow as each client may have
different list of Legal family names
for example
clientOne disallows certain letters...ie don't use DIOQSUV
clientTwo only disallows DIOQ
etc
so it's almost like I need a tblFamily for each client in tblClients or a
pointer to a list of disallowed letters...or something
In the user operating the program he should be able to enter JobNumber
(that will automatically setup which client we're dealing with)
then he enters (lets' say there's a button on a form to run the sub
"GetNextFamily" and the next un-used family name pops up out of the legal
list for that client(job)
or perhaps a combo box is shown with a list of all legal names for that job
and he selects from that....
so there's kind of like two groups of family names for a given job - the
legal list of all possible choices(at start of job)...and the resulting list
of all used choices on this job.(at end of job)
so maybe I need two tables - tblFamilyLegalList and tblFamilyUsedList...???
just guessing here
and again there may be multiple tblFamilyLegalLists (one for each client)(or
some clients may share the same list so it's not necessarily one to one
relationship...maybe there are 3 lists and 10 clients and each client gets a
pointer to one of the three lists...something like that
--------------------------------[color=blue]
> fldFamilyID PK[/color]
yes, I see the need for a PK ID field
--------------------------------[color=blue]
> fldCompSubTypeID FK[/color]
Here, I'm not sure why fldCompSubTypeID is in tblFamily....perhaps you can
illuminate your thinking in this item
I think fldCompSubTypeID would be in tblComponent...
in other words "what subtype of component is this component?" is a fact
about a component - not a fact about a familyname
although, all components will have a familyname
though how they are named may vary by what subtype they are
and also on a given job I may have a ComponentSubTypeOne(Caststone item)
with a family name of "P" and a ComponentID of "1" so the components
"fullname" would be = "P1"
and on the same job I may also have a ComponentSubTypeThree(hardware item)
and for that client, his standard for hardware cast into a panel might be
"P" so one item of hardware for that job may also be named "P1"
thus the family names for each componentSubType need to be segregated
somehow....
which I understand would be accommodated by your fldCompSubTypeID so maybe
that's the secret ingredient...I need to gestate on this one for a while I
think....I just don't understand yet why store it in tblFamily rather than
in tblComponent
is simplicity morphing into complexity yet? :-)
-------------------------------[color=blue]
> fldFamilyNumber Long[/color]
I don't see the need of a fldFamilyNumber, but maybe you see a need for this
I'm missing, could you elaborate?
I think this may be a duplicate of the PK field above??? (fldFamilyID)
--------------------------------[color=blue]
> fldFamilyName Text[/color]
Yes, this is my primary data(fact about component)
this is one record in the list of legal names right?
----------------------------------------------------------------------------
-[color=blue]
> tblCompA[/color]
Yes, if this is one of the Heirarchical subtype tables? but you said forget
heirarchy for now so maybe it's not???
If it is, i would have tblCompA, tblCompB, and tblCompC for the three
different subtypes??? is that right?
--------------------------------[color=blue]
> fldCAID PK[/color]
Yes
--------------------------------[color=blue]
> fldComponentSubTypeID FK[/color]
This seems like the samething as fldCAID above???
--------------------------------[color=blue]
> fldFamilyNumber FK[/color]
I would think this would be in the 'main' component table (tblComponent)
since all components would have this data
but I'm not sure if you're using my idea for how to divide "heirarchical"
entities as in my other post
--------------------------------[color=blue]
> fldShape Text[/color]
derived from fldFamilyNumber above...I would think this would be in
tblFamilyName...ie what shape does family"A" refer to on Job 12345
--------------------------------[color=blue]
> fldCompASpecificField Text[/color]
Yes, if this is the "heirarchical" table for this sub type then I would have
multiple fields like this describing the facts about this component fo this
sub type
I think in this subtype table (and all other subtype tables) I also need a
pointer to which piece(component) is being described
so I would add a field here
fldCompID FK (PK from tblComponent.fldCompID)
does that sound right?
[color=blue]
>
> I realize that this is a little abstract and Access-centric, but this
> is by far the best place to make design changes. Note that calculated
> values can still be done on-the-fly when you're forced to assign A1,
> A2, ...[/color]
I realize they *can* be calculated on the fly, but once done they become
immutable...if later entries are added after a part of a job has been
released, the calculations for already released pieces cant' change...only
new items can be added and if they are 'out of sequence' then they have to
be so identified in some fashion...that's why I thought I would store this
data after the initial calculation was done.
so on any further re-calculation(if pieces were added) I would check this
field for "NULL" and if it was Not Null then I leave it alone...
does that make sense???
Please refer to specific tables/fields in the sample schema[color=blue]
> above when discussing the merits or shortcomings of it. Also see if
> tblCompA, tblCompB, etc. have enough fields in common to create a
> single tblCompDetails containing fldCompType provided there are no
> plans to increase the number of component types in the future :-).
>
> I hope this rough outline helps you get started,
>[/color]
again, I can't thank you enough for helping me to think this through..
I relize this is a big complicated affair well beyond the usual short
question answer on this forum...thats why my initial hesitation
let me know If I'm overstepping my bounds on this forum
I really appreciate your willingness to help.
I also understand this is more than a 'small' question and if you wish to
deal with this in a way other than on ng let me know.
Thanks
Mark Propst
(mark atsymbol atreng dotsymbol com)
(I'm not as brave as you are if that's your real email <vbg> though even
without printing email address those spammers have no problem finding me
anyway so don't know how much good my paranoia does <g>)
[color=blue]
> James A. Fortune
>
CDMAPoster@FortuneJames.com
>[/color]