Greetings,
I am fairly new at DB design and I am having difficulty grasping how to create relationships between my tables. Please see my tables below.
What I was trying to accomplish is to have all customer information linked to the Customer table. For example, the Company, Employee, and Contact table would all link to the Customer table to make one large table. Then, I would link the Customer_ID field to the Ticket table and have all the data from the four "linked" tables. This just doesn't seem like it will work and I can't quite wrap my brain around the proper solution. Am I headed the right direction? Can somebody guide me in the right direction?
I am fairly new at DB design and I am having difficulty grasping how to create relationships between my tables. Please see my tables below.
Code:
----------------------------------
| CUSTOMER TABLE |
+---------------|-------|--------+
Customer_ID |INT |PRIM Key|
Company_ID |INT | |
Contact_ID |INT | |
Product_ID |INT | |
Customer_Type |CHAR | |
+--------------------------------+
----------------------------------
| COMPANY TABLE |
+---------------|-------|--------+
Company_ID |INT |PRIM Key|
Name |CHAR | |
Address |CHAR | |
City |CHAR | |
State |CHAR | |
ZipCode |CHAR | |
+--------------------------------+
----------------------------------
| EMPLOYEE TABLE |
+---------------|-------|--------+
Employee_ID |INT |PRIM Key|
Name |CHAR | |
Department |CHAR | |
Email |CHAR | |
+--------------------------------+
----------------------------------
| CONTACT TABLE |
+---------------|-------|--------+
Contact_ID |INT |PRIM Key|
Name |CHAR | |
Phone |CHAR | |
Position |CHAR | |
Email |CHAR | |
+--------------------------------+
----------------------------------
| TICKET TABLE |
+---------------|-------|--------+
Ticket_ID |INT |PRIM Key|
Customer_ID |INT | |
Source |CHAR | |
Date_Assigned |DATE | |
Date_Completed |DATE | |
Assigned_To |CHAR | |
Status |CHAR | |
Notes |CHAR | |
Priority |CHAR | |
Product |CHAR | |
Description |CHAR | |
Sales_Person |INT | |
+--------------------------------+
What I was trying to accomplish is to have all customer information linked to the Customer table. For example, the Company, Employee, and Contact table would all link to the Customer table to make one large table. Then, I would link the Customer_ID field to the Ticket table and have all the data from the four "linked" tables. This just doesn't seem like it will work and I can't quite wrap my brain around the proper solution. Am I headed the right direction? Can somebody guide me in the right direction?