473,604 Members | 2,487 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relationship between tables

Hi,

I have 4 tables, tblCompany, tblA, tblB and tblC.
tblA, tblB and tblC contain same type of data, they should be in one table,
but since there are many fields, I split it into 3 tables.
Each Company can have many records in tblA, so relationship between
tblCompany and tblA, tblB and tblC are 'one to many'.
tblA, tblB and tblC are in relationship 'one to one'
tblCompany has primary key CompanyID
tblA, tblB and tblC has same primary key which consist of two fields:
CompanyID and Date
1. Is this mistake that I put same names for primary keys in tblA, tblB,
tblC. Should I put like DateA, DateB, DateC
Note that CompanyID is from tblCompany because of relationship 'one to many'
How do I establish relationship:
a) tblA and tblB ('one to one') and tblB and tblC ('one to one') or
b) tblA and tblB ('one to one'), tbl B and tblC ('one to one'), tbl A and
tblC ('one to one') => each table is connected to other

2. also should I connect tblCompany to each table with 'one to many' (tblA,
tblB, tblC), or just with tblA

Please help, as I don't know what is result of this relationhips.

Thanks, Marco
Nov 12 '05 #1
2 2051
Before you go and make life obscenely complicated for yourself, is
there a real reason you have 4 1-to-1 tables? Seems kind of
excessive. How many fields do you have in each table? Are your
tables properly normalized? Are all of the 1-to-1 tables required
data or are there some instances where the parent record has no
related record in one or more of the 1-to-1 tables?

The only reason I ask is because if you normalize properly, you
usually don't have this problem. Or, if you really need this kind of
setup, why do you? I would answer that question first before trying
to implement a really difficult scheme. Of course, you could always
relate A-(1,M)-B-(1,1)-(1,1)... You might want to read Rebecca
Riordan's article at www.mvps.org/access on how she did it, just to
make sure you're not making a mistake.

HTH,
Pieter
Nov 12 '05 #2
Thanks Pieter,

I have asked before question on access.gettings tarted and this table
structure or similar (with more tables) is I quess needed.
tblCompany is one to many to others. tblA, tblB, tblC contain numeric
fields. I splited into 3 tables since there are 400 numeric fields which are
all related for same date. So tblA contain around 130 fields, tbl B and tbl
C also.
For example, I need to enter data on 15.01.2003. Fields are connected on
this date, but since there is 400 fields and they belong to one table, I
could split it into 10 or more tables, but then I need to collect data
again, and it is data of same date.

Each Company can have many records in tblA, so relationship between
tblCompany and tblA, tblB and tblC are 'one to many'.
tblA, tblB and tblC are in relationship 'one to one'
tblCompany has primary key CompanyID
tblA, tblB and tblC has same primary key which consist of two fields:
CompanyID and Date
1. Is this mistake that I put same names for primary keys in tblA, tblB,
tblC. Should I put like DateA, DateB, DateC
Note that CompanyID is from tblCompany because of relationship 'one to many'
How do I establish relationship:
a) tblA and tblB ('one to one') and tblB and tblC ('one to one') or
b) tblA and tblB ('one to one'), tbl B and tblC ('one to one'), tbl A and
tblC ('one to one') => each table is connected to other

2. also should I connect tblCompany to each table with 'one to many' (tblA,
tblB, tblC), or just with tblA

Your help is greatly appreciated,
Marco
"Pieter Linden" <pi********@hot mail.com> wrote in message
news:bf******** *************** ***@posting.goo gle.com...
Before you go and make life obscenely complicated for yourself, is
there a real reason you have 4 1-to-1 tables? Seems kind of
excessive. How many fields do you have in each table? Are your
tables properly normalized? Are all of the 1-to-1 tables required
data or are there some instances where the parent record has no
related record in one or more of the 1-to-1 tables?

The only reason I ask is because if you normalize properly, you
usually don't have this problem. Or, if you really need this kind of
setup, why do you? I would answer that question first before trying
to implement a really difficult scheme. Of course, you could always
relate A-(1,M)-B-(1,1)-(1,1)... You might want to read Rebecca
Riordan's article at www.mvps.org/access on how she did it, just to
make sure you're not making a mistake.

HTH,
Pieter

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
3860
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with other browsers (I checked it under Konqueror). Thank you in advance for your help. Regards. /Mariusz <HTML>
8
7429
by: Andante.in.Blue | last post by:
Hello, I have just inherited a legacy Access 97 database. While going through it, I noticed something strange... its Relationships window (the one accessed by Tools --> Relationships) is almost empty. Now, as I ponder how a relation database could work without any relationships, I noticed that the queries of the database defined some relationships between the source tables and queries. Which leads me to the question, what is the...
5
10858
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields in the old database with records and fields in the new database. For instance, her old database has a table with Band Info in it. Her new database also has a table with Band Info in it but slightly different. I was wondering if there was an easy way to compare the fields from similar tables in...
1
1553
by: Gt394 | last post by:
tbl_Quote PK QuoteNo tbl_QuoteDetails - Junction table between tbl_Quote and tbl_Product tbl_Product PK ProductID tbl_Thickness PK ThicknessID tbl_PanelType PK PanelID tbl_Ancillaries PK AncID contains a standard set of data...see below for example. tbl_Ancillaries has a fkey in tbl_Quote (ancillaries is an optional add on for user to
4
5575
by: niv | last post by:
Hi, I am unsure on how to retrieve data from tables 2 tables that are related through a relationship table.. TableOne -------- TableOneID TableOneDesc
2
2608
by: cspowart | last post by:
Consider first, table "A" : Plate Make Model ===================== ABC123 Ford F150 XYZ789 Dodge 1500 IJK444 Chev Silverado Then consider, table "B";
1
1423
by: learning_codes | last post by:
Hi, I need your help. I created a relationship on four tables. It works nicely. Each table has a code type. Group A Table --- Field Name: Code Type "T" Group B Table
1
1273
by: Ivan | last post by:
Hi I created a databse system but i have a problem figuring out how to create some tables / relationships.... The part of the systems that i am having problems with is the following i have a person (person table) that a specific date & time might be busy / available / tentative. I tried to create a different table for date and time so that i can define the times 01-24 and then i can reuse them.
6
3789
by: BD | last post by:
Hi, all. I need to enforce a one-to-many relationship on 2 tables, with a join table. Say the join table contains account information. It has cust_no and acct_no. Both cust_no and acct_no are child FKs to other tables (no nulls will exist in these columns). Logically, one customer can have several accounts, but one account can
0
7997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8419
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8065
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8280
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6739
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3907
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3955
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.