Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm trying to create a database for contacts. I must have many categories for every contact, like Home, Office, Emails, Phones. In every category one can add more than one value. Also the categories can be dynamic. How can this be designed in a database?

share|improve this question
    
You also asked this question on StackOverflow. I gave a fairly detailed answer there, so I'd like to recommend that you have a look. I think it addresses an aspect of your design issue that you may not have considered. –  Joel Brown Aug 28 '11 at 13:09
1  
I think your keyboard is missing the keys for period and comma... –  Rafa Jun 30 '12 at 20:36
add comment

4 Answers 4

Check out relational database design. It's an art and a science, and something that really can't be explained to the fullest in a post. But what you should do is create relationships between contacts and all possible data that will be related to it. This is most prevalent through the use of primary and foreign key relationships.

share|improve this answer
add comment

Have a look at "free data models" on databaseanswers.org. For example, "Contact Management"

Your question is too broad: you can hire me to do it of course :-)

share|improve this answer
add comment

Sounds like a pretty traditional relational database design.

CREATE TABLE Contact
(ContactId INT IDENTITY(1,1) PRIMARY KEY,
FirstName nvarchar(255),
LastName nvarchar(255))
GO
CREATE TABLE Methods
(MethodId INT IDENTITY(1,1) PRIMARY KEY,
MethodDescription VARCHAR(25))
GO
INSERT INTO Methods
(MethodDescription)
VALUES
('Work Phone'), ('Home Email'), ('Home Phone'), ('Work Email')
GO
CREATE TABLE ContactMethods
(ContactMethodsId INT IDENTITY(1,1) PRIMARY KEY,
ContactId INT,
MethodId INT)
GO
share|improve this answer
add comment

You should look at Universal Data Models for Party Contact Mechanism, which allows you to store as many contacts and category of contacts that you want.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.