Dear all,
I have a simple but very important database fundamental question on table relations with fixed values and its form design problem I am facing for easy data entry.
I have about 3 tables
o tbl_company
o tbl_Main_category
o tbl_Sub_category
The Main Category table has 8 records and subcategory table has 100 records shared differently by the 8 records from the Main Category table)-one to many related
o These values from both table are definite field values and cannot change i.e. - no new entry is required. However the information that will change is the records in tbl_company table i.e. new company details will be entered and a corresponding score value will be entered in the sub tbl_Sub_category
o A company will have a category with its subcategory and a score assigned to the subcategory of each company..in which a sub category is related to the main category
Database performance/process expectations: Behavior: When a new company is entered user need not have to re-enter any category + sub category infor to the new company since its pre–entered once
Form Design: Need to filter by company to see the related main and sub category values for each company.
My initial design: First attempt:
2 Relationships:
o tbl_Main_category - one side - tbl_Sub_category -many side
o tbl_Main_category is the one side & tbl_company is the many side Second attempt:
2 Relationships:
o tbl_company -one side tbl_Main_category - many side
o tbl_Main_category - one side - tbl_Sub_category -many side
Both the above table relations require the user to re-enter category & sub category values for each new company or vice versa.
I don’t know if this is the best way forward. .i.e. re-entering same values for each company.
Note: Once a new company is entered a score for each subcategory is entered.
Would appreciate a way forward on this:
I have gone in circles trying to come up with a workable method with the table relations and now numbed and exhausted.
I am also thinking of creating 8 tables representing the 8 main categories and have the subcategories as the field values but that will violet database design rules.
I don’t know how far I can apply the normalization rules.
Thanks in advance for any help!!!
When maintainng this table, it's essential to keep it up-to-date with the main/sub category table.
As tables can change (even when you say it's not possible), I prefer to create these records always from scratch, thus making sure it's 100% equal to the original table.
Nic;o)
10 1783
I'm having trouble understanding the relationships between the table, especially in regards to the score and why it would be stored in the subcategory table.
Can you post some sample data from each table?
NeoPa 32,556
Expert Mod 16PB Jerry:
When a new company is entered user need not have to re-enter any category + sub category info to the new company since its pre-entered once
Surely every new company needs the FK values set up for the other two tables? I assume you are saying that that work will be the extent of what is required to categorise any new company?
I would expect that to require ComboBox lists populated with the existing records, from which one is selected for each of the Category and Sub-Category values.
Rabbit, the subcategories are definite criteria names that are used to measure a company..once measured a score value is assigned to each sub category for the company..The subcategory names does not change for any new company as these are the measurement tools for company assessment. So like I was saying when a new company is measured, only the score value is required to be entered for each corresponding subcategory. NeoPa You are right. That is exactly what I would like achieve in the table relations but could you eloborate further on populating values from combo box .
I am sorry if am too shallow on my question..
NeoPa 32,556
Expert Mod 16PB
I'm happy to explain further when I'm sure I understand what you're asking Jerry. I'm fairly certain you're talking about linking to separate tables using Foreign Keys, but it would be easier to be sure if you posted some example Category and Sub-Category data.
Assuming I'm right about what I think you're saying then :
To identify the Category (We'll ignore the subs for now as they're the same anyway.) from within the Company table you would want an FK field that would match one of the values in the PK of the Category records. To make this easy to enter you would put in a ComboBox on the Company form which is bound to the FK field, but contains a list of all the valid PKs from the Category table. Thus, only valid IDs are able to be entered. The ComboBox can include more than one field from the Category table in order to help the operator identify the desired record correctly, but only one field is actually stored in the Company's FK field.
NeoPa,
I just did what you mentioned with some additions/changes.
I have moved the score field to a new table since each sub category in a company will have a different score.
Now on the company form I did the cmbo FK loop up and is fine (I think so)
Now since the sub category for the company is required to be also viewed on the same form I have created a subform filtred by Category FK on main form (company form) to Category FK on the subform (subcategory form-datasheet).
I am still muddled on how data is being handled (background relations) especially when entering a new company name since each company belong to a category having subcategories with different scores.
I don know if my table relations is correct.
I have attached the sample db for you & others (Rabbit) sighting
NeoPa 32,556
Expert Mod 16PB
I'll look if I get some time Jerry, but these things normally take more than working on a page in text, and I'm very busy with work ATM (which is why I'm still up at 05:00 anyway). I'll leave it as an open page in my browser for now.
Ok thanks NeoPa. Would appreciate if someone else can also assist where necessary.
I get the impression you need to record the sub-category scores for a company based on the Main category that's defined when the company is defined.
Two remarks:
1) Not being able to change the Main-Category on a defined company is strange, as people do make mistakes.
2) Your Score table doesn't hold the Company-ID.
My approach would be to have the company-ID in the tblScore and to automatically add the subcategory records to the tblScore when the Main-Category is selected.
To make changes of the MainCategory possible I would just add a DELETE * from tblScore where Company-ID = current-Company-ID before I add the sub-category score records.
Getting the idea ?
Nic;o)
Hi Nico..thanks for the reply. I agree with you on the table relations to have the tblscore connected to tblcompany but could yo eloborate further on data deletion portion of your suggestion...
Thanks..
Reply posted via android phone
When maintainng this table, it's essential to keep it up-to-date with the main/sub category table.
As tables can change (even when you say it's not possible), I prefer to create these records always from scratch, thus making sure it's 100% equal to the original table.
Nic;o)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Michael Schuerig |
last post by:
I'm trying to do something seemingly very simple, but it's brought me
close to crushing my head on the keyboard. All I want is a table where
the head row is fixed and the body columns below are...
|
by: Henry |
last post by:
Dear all,
I am now designing a table for storing inventory of servers in a DB2
DB. However, I am new to SQL and would like to seek advice whether the
design could work as expect with DB2 SQL.
...
|
by: John Baker |
last post by:
Hi:
Access 2000 W98!
I have a table with numerous records in it, and am attempting to delete certain records
that have been selected from it. These are selected based on the ID number in a...
|
by: misscrf |
last post by:
I am currently working on a database, in 3rd normal form, which is for
candidates who apply for a job with the law firm that I
workd for. My issue is with good form design.
I have a main...
|
by: Nikolay Petrov |
last post by:
Is there a way to get table relations from SQL server to a set?
TIA
|
by: yanjie.ma |
last post by:
Hi,
I've got a two part question on table and form design (sorry for the
length but it takes a bit to explain). Our sales department uses a
look-up table to help the them select the best...
|
by: patl |
last post by:
Hi all,
I am trying to write a terminal emulator using Javascript + AJAX and I
need to create an 80x25 table (each cell
contains 1 character) in which I can update the contents of each cell...
|
by: Diogenes |
last post by:
Hi All;
I, like others, have been frustrated with designing
forms that look and flow the same in both IE and Firefox.
They simply did not scale the same.
I have discovered, to my chagrin,...
|
by: nethravathy |
last post by:
Hi,
The following table namely elcbtripselect contains 5147 records.I want to know wether this table contains duplicate records or not.
I tried with following query
1)SELECT...
|
by: Karl |
last post by:
Using A2000
When I click the save icon in form design, Access closes immediately. No
warning messges, nothing.
This happens on only one form. I deleted the form and recreated it. I could
save...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |