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

  • SEARCH
  • Home
  • 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 235377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:15:36+00:00 2026-05-11T20:15:36+00:00

For a while, I’ve been told by a number of people that a listing

  • 0

For a while, I’ve been told by a number of people that a listing of U.S. States (and territories) should be stored in a database table and cached for applications that use the information. The only reasons they give me for this is to promote normalization and because “it’s how we’ve always done it”.

Now if the list changes often because the scope of the application grows internationally (say to include Canadian Provinces), I can understand abstracting the list to a data table that would also indicate a country identifier as well. However, if the list is pretty much locked and only used on 1 screen of the application, is it worth doing the query and caching? Is the difference between storing an SMALLINT foreign key that much better than a CHAR(2)? Is it always practical?

Was just pondering this trend that I’ve seen with the companies that I’ve worked with.

  • 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-11T20:15:36+00:00Added an answer on May 11, 2026 at 8:15 pm

    I put them in the database, for a few reasons:

    1. It’s just good normalization practice.

    2. Why should I hardcode any data in my application if I can avoid that by putting it in the database?

    3. Personally, I like the comfort of the guaranteed uniqueness property. When two tables point to the same foreign key, I know that they are referencning the same thing. When two happen to share the same two character code… well, then it’s up to the application.

    4. Constraint Checks…. lots of two character codes are illegal, but the database won’t be able to help you with that. It’s a lot harder to have an illegal foreign key entry.

    5. Speed. I haven’t benchmarked, so I may be wrong, but I bet having the database combine entries for you is faster than you doing it yourself. If you are using the state code for anything else (e.g., to get the non-abbreviated name of the state, or to maintain a list of valid zipcodes for that state ), a join is probably faster than whatever you would write.

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

Sidebar

Related Questions

While writing an application that interacts with a database the only way I can
While making some final tests of a class-library that I'm writing for Windows Mobile
While trying to verify to myself, that C# Equals for IEnumerables is a reference
While programming with python I am often confused with the following ambiguity: should it
While database design I used a field name deleted and use it as Boolean.
While trying to install a program from source I found that it installed libraries
While converting database project to SSDT and upgrading to SQL Server 2012 I need
While I understand the Math.round/ceil/floor functions in javascript, I have been unable to come
While fetching Boolean data from database with hibernate SQL query gives the following error
While debugging my NServiceBus enabled application, I have certain messages that are reported in

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.