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 7857483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:03:32+00:00 2026-06-02T21:03:32+00:00

New to Oracle SQL and I assume that this is a very straight forward

  • 0

New to Oracle SQL and I assume that this is a very straight forward question but I can’t find a direct answer. I have an employees table in my database. One of the columns is ’emp_state’ which is to show the State in which the employee resides. I also have a ‘Customer’ table and an ‘office’ table, which also both have a ‘State’ field. To reduce the amount of redundant data in my database, I have created a ‘State’ table, which will have all the states with a corresponding ID. I want to reference this table in the other tables as mentioned. When setting up my table, what should I define as the foreign key in the relevant tables? Should it be ‘State_id’ or ‘State_name’? I want the state name to appear in any queries that are run, rather than the state ID which would be meaningless to a user.

Thank you!

  • 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-06-02T21:03:33+00:00Added an answer on June 2, 2026 at 9:03 pm
    • You should use state_id. If is much faster to join on a INT then a VARCHAR.
    • If you need the name if a state the you should JOIN on the table and get it
    • If you are planing to update the state name then you need to update all the relate tables. If you have a id then you just need to update the name column.
    • You would probably not have the same state name twice. But what if you do? Then you must change it or append some strange number on the state name.

    So bottom line: Always use the id

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

Sidebar

Related Questions

I'm very new to oracle but I've been learning about it in class and
This might be simple but I am new to Oracle. I am using Oracle
Im new to cursors in Oracle. I have a piece of SQL that is
I am very new to Oracle PL/SQL... What is the difference between Oracle Functions,
Tried running a java method that runs this oracle SQL query String query =
SQL Server 2012 introduced Sequence as a new feature, same as in Oracle and
I have an Excel file that I need to import into a (new) Oracle
I'm very new to Oracle and was wondering if there's a way either through
I am new to Oracle database. I see that if I connect as sys
I'm new to Oracle and I'm wondering if anyone can tell me what is

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.