Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 711383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:43:44+00:00 2026-05-14T04:43:44+00:00

What is the best way to store settings for certain objects in my database?

  • 0

What is the best way to store settings for certain objects in my database?

  1. Method one: Using a single table
    Table: Company {CompanyID, CompanyName, AutoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter}

  2. Method two: Using two tables
    Table Company {CompanyID, COmpanyName}
    Table2 CompanySettings{CompanyID, utoEmail, AutoEmailAddress, AutoPrint, AutoPrintPrinter}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:43:45+00:00Added an answer on May 14, 2026 at 4:43 am

    I would take things a step further…

    Table 1 – Company

    CompanyID (int)
    CompanyName (string)
    

    Example

    CompanyID 1
    CompanyName "Swift Point"
    

    Table 2 – Contact Types

    ContactTypeID (int)
    ContactType (string)
    

    Example

    ContactTypeID 1
    ContactType "AutoEmail"
    

    Table 3 Company Contact

    CompanyID (int)
    ContactTypeID (int)
    Addressing (string)
    

    Example

    CompanyID 1
    ContactTypeID 1
    Addressing "name@address.blah"
    

    This solution gives you extensibility as you won’t need to add columns to cope with new contact types in the future.

    SELECT
       [company].CompanyID,
       [company].CompanyName,
       [contacttype].ContactTypeID,
       [contacttype].ContactType,
       [companycontact].Addressing
    FROM
       [company]
    INNER JOIN
       [companycontact] ON [companycontact].CompanyID = [company].CompanyID
    INNER JOIN
       [contacttype] ON [contacttype].ContactTypeID = [companycontact].ContactTypeID
    

    This would give you multiple rows for each company. A row for “AutoEmail” a row for “AutoPrint” and maybe in the future a row for “ManualEmail”, “AutoFax” or even “AutoTeleport”.

    Response to HLEM.

    Yes, this is indeed the EAV model. It is useful where you want to have an extensible list of attributes with similar data. In this case, varying methods of contact with a string that represents the “address” of the contact.

    If you didn’t want to use the EAV model, you should next consider relational tables, rather than storing the data in flat tables. This is because this data will almost certainly extend.

    Neither EAV model nor the relational model significantly slow queries. Joins are actually very fast, compared with (for example) a sort. Returning a record for a company with all of its associated contact types, or indeed a specific contact type would be very fast. I am working on a financial MS SQL database with millions of rows and similar data models and have no problem returning significant amounts of data in sub-second timings.

    In terms of complexity, this isn’t the most technical design in terms of database modelling and the concept of joining tables is most definitely below what I would consider to be “intermediate” level database development.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best way to store international addresses in a database? Answer in
What's the best way to store a linked list in a MySQL database so
What is the best way to store instances of a class to file/database? We
I'm wondering what the best way is to store user settings? For a web
Possible Duplicate: What is the best way to store user settings for a .NET
What is the best way to store array of of primitive types using Rails
What is the best way to store string data across postback. I need to
What is the best way to store a large amount of text in a
What's the best way to store tags for a record? Just use a varchar
What's the best way to store timezone information with dates/times in a uniform way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.