Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Database SEtup QUestion

Posted on 2014-03-23
2
Medium Priority
?
266 Views
Last Modified: 2014-04-22
Hi All,

I am trying to setup a company database with this data, let me know the best setup for this.  There could be up to 20 contacts per company:

company name
Address
Main Number
Industry
Website


Direct Contact 1
phone Number
email address
address

Direct Contact 2
phone number
email address
address
0
Comment
Question by:Jack_son_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Assisted Solution

by:Dan Craciun
Dan Craciun earned 1000 total points
ID: 39949064
Doesn't matter how many contacts there are.
Setup a table for companies and a table for contacts, with a company_id foreign key in the contacts table.

HTH,
Dan
0
 
LVL 40

Accepted Solution

by:
lcohan earned 1000 total points
ID: 39957341
Something like:

create table company
(
      company_id int primary key,
      company_name varchar(255),
      company_Address varchar(255),
      Main_Number int,
      Industry varchar(100),
      Website varchar(2000)
);

create table contacts
(
      contact_id int primary key,
      company_id int,
      contact_first_name varchar(100),
      contact_last_name varchar(100),
      phone_Number varchar(100),
      email_address  varchar(100),
      contact_address  varchar(100),
      contact_city  varchar(100),
      contact_state_province  varchar(100),
      contact_country  varchar(100),
      contact_postal_code  varchar(20)-- ...etc...
);


ALTER TABLE contacts ADD FOREIGN KEY (FK_company_id) REFERENCES company(company_id);
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question