Re: 1 to many relationships

2006-08-16 Thread Chris

Brian E Boothe wrote:

hey guys ;
   it's not Customers Per issue it's the other way around "issues per 
customer"
i enter in Customer 1 and then down the road i wanna add a issue 
associated with that customer, so goto that customer and Click "Add issue"
the a form Comes up and i add the issue and Click Add issue, i need that 
issue to associate with that customer, every Customer Refrences the same 
issue table

i have Customers   /Issues as tables,


As William said you have a 1 to many relationship so you can get away 
with this as a very simple example:


create table customers (customerid int auto_increment primary key,
customername varchar(255));

create table issues (issueid int auto_increment primary key, issuetitle
varchar(255), customerid int);


then you have a simple inner join to find the issues that each customer has.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: 1 to many relationships

2006-08-16 Thread William R. Mussatto
Gerald L. Clark said:
> Brian E Boothe wrote:
>> hey guys ;
>>it's not Customers Per issue it's the other way around "issues per
>> customer"
>> i enter in Customer 1 and then down the road i wanna add a issue
>> associated with that customer, so goto that customer and Click "Add
>> issue"
>> the a form Comes up and i add the issue and Click Add issue, i need that
>> issue to associate with that customer, every Customer Refrences the same
>> issue table
> Then it is many to many.
> Many customers are associated with many issues.
>> i have Customers   /Issues as tables,
>
>
> --
> Gerald L. Clark
> Supplier Systems Corporation
I beg to differ.  It would be a many to many if several customers were
related to the same issue.
If each customer can have one or more issues, but no issue can 'belong' to
more than one customer then its 1 to many and you can put the customer ID
in the issues table.
If several customers can have the same issue (row) then you will need an
intermediate table which has two columns: customerID and issueID.



---

William R. Mussatto, Senior Systems Engineer
http://www.csz.com
Ph. 909-920-9154 ext. 27
FAX. 909-608-7061


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: 1 to many relationships

2006-08-16 Thread Gerald L. Clark

Brian E Boothe wrote:

hey guys ;
   it's not Customers Per issue it's the other way around "issues per 
customer"
i enter in Customer 1 and then down the road i wanna add a issue 
associated with that customer, so goto that customer and Click "Add issue"
the a form Comes up and i add the issue and Click Add issue, i need that 
issue to associate with that customer, every Customer Refrences the same 
issue table

Then it is many to many.
Many customers are associated with many issues.

i have Customers   /Issues as tables,



--
Gerald L. Clark
Supplier Systems Corporation

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



1 to many relationships

2006-08-16 Thread Brian E Boothe

hey guys ;
   it's not Customers Per issue it's the other way around "issues per 
customer"
i enter in Customer 1 and then down the road i wanna add a issue 
associated with that customer, so goto that customer and Click "Add issue"
the a form Comes up and i add the issue and Click Add issue, i need 
that issue to associate with that customer, every Customer Refrences the 
same issue table
i have Customers   /Issues as tables, 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]