473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Why is it sometimes necessary to join two fields in one table to two fields in anothe

An Access book I looked at called this topic "creating a relationship on multiple fields." I want to know why this is necessary. For example, I found it necessary to link two fields between two tables in recalculating inventory quantities to reduce appropriately the number of records returned in the query. Two of the 4 tables involved in my inventory queries had a compound primary key, i.e. two fields in the table were primary keys. Do 2 primary keys necessitate two links between tables? If not, what is the reason that two links between 2 tables is necessary?
Jan 22 '15 #1
1 961
jimatqsi
1,271 Expert 1GB
Think about the relationship between the data in the tables. Suppose you sell the same item from more than one warehouse. Imagine a sales order to sell an item. The sales order must specify both the item number and the warehouse to pull stock from. So the relationship between that one line item on a sales order and the item-warehouse table must include two pieces of data to find the right row to reduce the stock from.

If you stop looking in the item-warehouse file after you find the item you may reduce stock from the wrong warehouse. If you look only for the warehouse you may reduce stock for the wrong item.

Jim
Jan 22 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Silas | last post by:
Hi, I use view to join difference table together for some function. However, when the "real" table fields changed (e.g. add/delete/change field). The view table still use the "old fields". ...
1
by: Chris Lutka | last post by:
I've been racking my brains all day over this. And I'm not the best at SQL either. I need a query that will produce the following results:...
3
by: DStark | last post by:
Hi! Is it possible to iterate through table fields in an ADP? What I'd like to do is: Sub PrintTableFields() Dim dbs As Object Dim tbl As AccessObject Dim fld As ???? Set dbs =...
3
by: MLH | last post by:
I have a query, qryAppend30DayOld260ies that attempts to append records to tblCorrespondence. When run, it can result in any of the following: appending no records, appending 1 record or appending...
1
by: prisesh26 | last post by:
i ve two tables tblpost and tblreply.. in tblpost i ve three fields postid,title,user and in tblreply postid,replies. postid is primary key for tblpost and i made postid in tblreply as a foreign...
2
by: rcamarda | last post by:
Hello, I need to alter fields in all my tables of a given database, and I would to do this via a t-sql script. Example, I want to change all fields called SESSION_ID to char(6). The field is...
1
by: govindpraveen | last post by:
I have 4 tables 1)category fields -------id-----catrgory 2)Manufacturer fields---------id--------manufacturer---------category_id-------------- 3) Models...
1
by: Vicente | last post by:
The form fields are bound correctly to corresponding table fields. This is a simple table with a simple form (3 fields)
3
by: Daryl Austin | last post by:
I know this can be down, I'm just not sure where to begin. I have a table with fields , basically I am using Access to manage sales proposals. I export out to Excel a report query based on...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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,...
0
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,...

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.