Table/Model Relationship
I'm going to re-phrase this question:
I have 2 tables that are unrelated. There is an instance where the two tables might need to be related:
Table 1 = (Opportunity for A sale) This information is generated every time a person comes through the door and describes their visit.
Table 2 = (Customer) This is an existing开发者_如何转开发 record in the database.
I want to associate a record in table 1 with a record in table 2 if the person walking through the door is an existing customer.
I assume the way to do this is a third table with the ID's of table 1 & 2 with the direction being Many from the 3rd table and 1 to table 1 and 2?
You can just include the Customer key in the Opportunities table and make it nullable.
The only time you'd need a Junction Table (the 3rd table you describe), would be if many customers could be associated with a single Opportunity.
精彩评论