473,382 Members | 1,784 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,382 software developers and data experts.

Creating a Join Table -Square One

I am not very strong in databases, so you must forgive any obvious
stupidity.
After having a good look at our Sales Managemend database, we decided
there is something basially wrong.

Our Agents sell financials to only a few customers. The database was
set up as...
Table Table (Join)
Table
Agent (AgentID ) (AgentID)( >Customer(CustomerID)

But we have Agents who have not sold yet and will always have that
scenario.

So we are creating

Table Table (Join)
Table Table
Agent (AgentID ) (AgentID)(CustomerID) >Customer(CustomerID)>Product
Type)(UnitsSold)(CustomerID)

I am trying to figure out my joins as to make sure we have our form
queries correct.

If I run a Make Table query with the old relationships, I can get the
(AgentID)(CustomerID)
Table.
What I will be missing is 400+ records. The Agents who have no sales
or orphan Austomers who have no agents.

Am I going about this the right way?
Sure would like a little guidance

Sep 25 '06 #1
3 1672

CanFlightSim wrote:
I am not very strong in databases, so you must forgive any obvious
stupidity.
After having a good look at our Sales Managemend database, we decided
there is something basially wrong.

Our Agents sell financials to only a few customers. The database was
set up as...
Table Table (Join)
Table
Agent (AgentID ) (AgentID)( >Customer(CustomerID)

But we have Agents who have not sold yet and will always have that
scenario.

So we are creating

Table Table (Join)
Table Table
Agent (AgentID ) (AgentID)(CustomerID) >Customer(CustomerID)>Product
Type)(UnitsSold)(CustomerID)

I am trying to figure out my joins as to make sure we have our form
queries correct.

If I run a Make Table query with the old relationships, I can get the
(AgentID)(CustomerID)
Table.
What I will be missing is 400+ records. The Agents who have no sales
or orphan Austomers who have no agents.

Am I going about this the right way?
Sure would like a little guidance

Sounds like the database design is probably OK. You need an _outer_
join instead of an inner join in your query. Inner joins "lose"
records when there are no matches between the two tables. (only the
records with matches on both sides show). If you want to show all the
records from one table, click on the link in the query and change it to
"Show all..." and set it to your Agents.

Sep 25 '06 #2
My intuition is that "products sold" is a property of the relation
between an agent and a customer. So, I think you must have some sort of
Y-shaped relations window:

both Agent and Customer are parents of the intermediate table, which I'd
name AgentCustomer; and below this table there will be the intermediate
table to Product, I'd name this either AgentCustomerProduct or Sale,
depending on my manager ;)

But, if you want to be able to trace some history, and there can be more
than one contact between an Agent and (the same) Customer, you need
another step.

Hope I'm not shooting over your head here.
--
Bas Cost Budde
Holland
Sep 25 '06 #3

Bas Cost Budde wrote:
My intuition is that "products sold" is a property of the relation
between an agent and a customer. So, I think you must have some sort of
Y-shaped relations window: ....
Well a lot of water has gone under the bridge ...

I restructured as some of your suggestion.

Agents----AgentInvestorJoin-----Investor

For the main tables. Works real clean.

Agents--- ContactDetails

Is a one to many contact details with date and what was done.

Investors ---- Purchases

One to many Purchases

I can query through the join table to Have all the Purchases that are
owned by a broker
In addition, I have put in a delete flag and front ended a module to
handle "deletions"

Things seem to make more sense because there are times that an Agent
does no have investors. And an investor looses an agent.

Thanks for your help. Met a lot of folks from the Netherlands in my
city this summer. Over 100 or so.

Wild Bill

Oct 18 '06 #4

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

Similar topics

2
by: Bill | last post by:
I have the following situation. We sell books on our website, and some of the books have more than one author. So I needed to create a many-to-many table, which is the intermidiate table between...
3
by: Indraneel Sheorey | last post by:
Hello, I want to set up a query in SQL Server that is "grouped by" a variable PRICE. Since PRICE takes on continuous decimal values, I want to create deciles based on this variable and then...
11
by: randi_clausen | last post by:
Using SQL against a DB2 table the 'with' key word is used to dynamically create a temporary table with an SQL statement that is retained for the duration of that SQL statement. What is the...
31
by: Neil | last post by:
I have an Access 2000 MDB with ODBC linked tables to a SQL Server 7 back end. I currently have a selections table in the front end file which the users use to make selections of records. The table...
5
by: Mike Turco | last post by:
What is the difference between creating relationships in the front-end vs. the back-end database? I was trying to create a relationship in a database front-end and noticed that I could not check...
2
by: Gandalf | last post by:
I'm creating relationships between tables using VBA and ADOX. I can create one-to-one relationships with an inner join, but I can't figure out how to create these relationships with an outer join...
6
by: davegb | last post by:
I'm trying to create a self-join table to show the relationship between employee and supervisor. In another thread, I was advised to create a SupervisorID in the employee table, a separate...
3
by: erick-flores | last post by:
Hello all I am creating an Expense Report. There are to types of expenses: Company expenses and Reimb Expeneses. The company expenses is under "Expense Details Co" table and Reimb Expenses is...
7
by: rcamarda | last post by:
I wish to build a table based on values from another table. I need to populate a table between two dates from another table. Using the START_DT and END_DT, create records between those dates. I...
3
by: Bhavsan | last post by:
Here is what I am trying to do. Kindly, help me. 1. I'm creating a query dynamically based on User input using VBA (strSQL and DotSQL in the code below) 2. Executing the created query with in VBA...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
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...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.