473,804 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relationship question

I am learning Access, and have one question on relationships. How does one
handle establishing a relationship that could be one-to-many, going either
way between two tables? Example: One table lists home addresses. Another
table lists kinds of correspondence (letters sent). There is a 3rd table
with letter information (date, topic, etc.). There could be 100 addresses
in one table and 10 kinds of letters in another table. There could be one
kind of letter going to many addresses, or, one address receiving many kinds
of letters. How is this dealt with? Or is this problem evidence that
something is not set up right with the tables?

Thank you,

- Phil
Nov 13 '05 #1
2 1396
"Phil" <p.*****@comcas t.net> wrote in message
news:ojJCc.1767 90$Ly.56856@att bi_s01...
I am learning Access, and have one question on relationships. How does one
handle establishing a relationship that could be one-to-many, going either
way between two tables? Example: One table lists home addresses. Another
table lists kinds of correspondence (letters sent). There is a 3rd table
with letter information (date, topic, etc.). There could be 100 addresses
in one table and 10 kinds of letters in another table. There could be one
kind of letter going to many addresses, or, one address receiving many kinds
of letters. How is this dealt with? Or is this problem evidence that
something is not set up right with the tables?


What you're describing is a Many-To-Many relationship and it requires a third
table where each record is a combination of Primary Keys from your current
tables.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
In message <2k************ *@uni-berlin.de>, Rick Brandt
<ri*********@ho tmail.com> writes
"Phil" <p.*****@comcas t.net> wrote in message
news:ojJCc.176 790$Ly.56856@at tbi_s01...
I am learning Access, and have one question on relationships. How does one
handle establishing a relationship that could be one-to-many, going either
way between two tables? Example: One table lists home addresses. Another
table lists kinds of correspondence (letters sent). There is a 3rd table
with letter information (date, topic, etc.). There could be 100 addresses
in one table and 10 kinds of letters in another table. There could be one
kind of letter going to many addresses, or, one address receiving many kinds
of letters. How is this dealt with? Or is this problem evidence that
something is not set up right with the tables?


What you're describing is a Many-To-Many relationship and it requires a third
table where each record is a combination of Primary Keys from your current
tables.


When you need to create a link table it's worth taking some time to look
closely at the data structure. Quite often those link tables correspond
to some real-world object and you find that they need more fields than
just the keys of the other tables involved.

--
Bernard Peek
London, UK. DBA, Manager, Trainer & Author. Will work for money.

Nov 13 '05 #3

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

Similar topics

4
1550
by: H Cohen | last post by:
Hi, I have a corporate database with about 60 different tables that spans manufacturing, accounting, marketing, etc. It is possible, but unwieldy, to establish a relationship for each table in the entire database through critical fields like customer_id or product_id. But should I do that?
2
2761
by: Stewart Johnson | last post by:
Hey All - I'm stuck while trying to write a schema, hoping someone can provide me with a flash of inspiration. One of the elements I'm writing has two attributes, both of which are optional. I want to express in the schema that there's a relationship between the two -- that the second attribute is optional only if the first one is not specified. ie:
8
7439
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...
2
1983
by: William Bradley | last post by:
Some help with relationships would be appreciated. I have read up on them but am still a bit vague ... The tables are as follows: 1. Main table -- this holds information about a product we buy and the name of the vendor gained from the Venor table via a combo box. .. 2. Vendor table -- Name, address, phone etc.
2
3423
by: Larry R Harrison Jr | last post by:
I have an Access 97 database with 2 tables that have a one-many relationship. I have a SQL statement in the "one" table which I want to execute and insert 7 records into the "many" table, and I want them to be linked to the "main" table. Problem is, it won't let me run the SQL run as long as the one-many relationship is established in the relationship window. The SQL is:
2
2071
by: Marco Simone | last post by:
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...
3
1623
by: Mason | last post by:
I have a table consisting of people and their attributes. I would like to create a relationship matrix table that records the relationships between the people. So the two tables would look something like this: tblPeople *ID, AutoNumber LastName, Text FirstName, Text
1
2480
by: Michael D. Reed | last post by:
I have two tables in an Access database with a Many-to-Many relationship, there is a connection table. The tables are , , and the connection table is this is a standard Many-to-Many relationship in that the connect table only has two foreign key columns one for each of the other table primary keys, a very straightforward setup. The above is setup in a data set in a Data Set called “ProductDataSet” in a C# program. I have a record...
2
2619
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";
0
9712
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10595
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...
0
9171
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 projectplanning, coding, testing, and deploymentwithout 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
7634
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
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
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
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
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
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.