Explain me about natural key

Anybody explain me about natural key and what situations use this type of keys in RPD?
Thanks in Advance.

Hi ,
Check the below link
http://gerardnico.com/wiki/data_modeling/key
Thanks,
Ananth

Similar Messages

  • Some basic questions about foriegn key , and relationships.

    Hi
    Thank you for reading my post
    I read some documents about foreugn key and tables relation ships.
    but i still can not understnad some stuff.
    1-when we have a foreign key , we have two tables that we want to relate them together
    in a way that one of ? table columns forced to be a value from ?? table column.
    what is name of those two tables , i saw , child-parent , ..... which confuse me.
    can some one please tell me correct name of those two tables ?
    2-some times we need some kind of master details relation like :
    one-to-many : i this case MANY table will have a column to point a record in ONE table , can this relation be a foreign key relation ?
    3-we can achieve many-to-many relation only by using a helper table to host both tables primary keys in a record to relate them together.
    can you point me to some resources that help me to find answers to this questions ?
    or explain them to me ?
    thank you for your time.

    These are critical database basics that you need to understand. I would seriously recommend getting some study in, because proper relational database design relies on the basic principle of data and relationships and a process called normalization.
    In reality, you only really need one gigantic table to host data. It would include everything you would want to know about something - let's take a sales order for example. You would have to record the customer's name, address, etc. along with every item they ordered, etc. You would have a HUGE table full of data that appeared over and over and over again. This is bad design for two basic reasons: it is difficult to query, and it is very easy to have minor mistakes like capitalization or alternate spellings that prevent things from matching up properly. For example, let's say Bob orders 40 widgets and 40 digits. In our hypothetical table, we could put it in as Bob - 40 widgets and Robert - 40 digits. See how confusing this can get even in a simple example? And let's say you wanted to correct all of Robert's orders to say Bob and you found out there were 40 orders from "Robert" How would you know which ones to change?
    The process of normalization helps to reduce the chance for these types of errors in addition to creating a good basis for indexes. You normalize the data by creating sets of parent/child tables with a "key" value to match them. In our hypothetical situation, you could create a table for orders and a table for customers. In the customers table you give all the detail for the customer in one place, and you assign each customer a unique number or ID. In the orders table we add the customer ID (NOT the name) and we ensure that we are getting the customer we want, in addition to saving a lot of space and eliminating redundancy. In our example, the customers table is the "parent" table and the orders table is the "child" table. The child table references the unique entries in the parent table via that id. That reference is referred to as a foreign key. The foreign key in the child table points back to the original and complete record in the parent table and eliminates the redundancy of keeping all that extra data for every order. Foreign keys in child tables always refer to a primary/unique key in the parent field.
    That help?

  • Given that I'll use a natural key, how do I deal with the situation if I find out the value later?

    I have been doing a lot of reading about the pros and cons of using natural versus surrogate keys.  I have read in Joe Celko's books and his writing online that he strongly opposes using surrogate keys and using IDENTITY for generating values for a
    surrogate key column of a table in SQL Server.  I would like some advice on how to handle this situation:  I have a table with physician information and would like to use their NPI as a natural key (it would be a foreign key in many other tables)
    but the people who enter new physicians often don't know the NPI until later.  They also may receive the wrong NPI and need to change it later.
    Right now they use Excel spreadsheets to manage their data and I'm sure you can understand what a nightmare of data integrity that is.  Now that I'm going to design and build a database for them, can you recommend a good approach to this specific problem?
     I cannot tell them to hold on to the new physician's data until they get the NPI because they need to immediately work with the physician's information as soon as the new physician joins the organization.  It's a small shop and not a health system
    but thousands of physicians join.  They cannot insist that the NPI be supplied at the time of registration for various political reasons.  The people who are using the system now have varying degrees of skepticism to outright vehement opposition
    to having a new database system so I cannot "lay down the law" about things that may adversely affect the relationship with the new physicians who sign up.  With the Excel spreadsheets they cope with this by either leaving it blank, entering
    9999999 or some other stray string of characters, or perhaps typing in their shopping list.
    Is there a viable solution to this design problem?  Any and all suggestions appreciated.  Thanks for reading this.

    While I disagree with the standard practice of adding an identity column as the primary key for every table, I think that this is a case where it can be beneficial or practical.  You might not want to cluster on the identity column and you still need
    to enforce the uniqueness of the natural key. 
    OTOH, the alternative is to simply fabricate a value for the natural key when it is unknown.  You could do this manually (where the user must enter the fabricated value) or automatically (where the server generates it).  A manual approach might
    be frustrating to the users since they have to "guess" what would be unique and acceptable, resulting in sort of trial-and-error approach to adding.  You would also very likely need to have a way of identifying which rows had a fabricated value.  Once
    the actual natural key has been identified for a given provider you would then need to update it.  The server can handle cascading the value where needed if you so choose.  Note that, except for the cascading part, you need the same capabilities
    for an identity-based table since this natural key is most likely essential to the system. 
    I'll also point out that you can use a unique constraint as the target of a foreign key - you don't have to use the primary key.  Not recommending this, just mentioning the alternative.  
    Which you should choose I can't say - that requires a much better understanding of your model and that isn't something that can be readily provided in a forum such as this.  I will say that you should not prematurely choose an identity.  Why?  First,
    you make this choice once you have deemed the natural key to be a problem.  Second, it may be (at least) some of your anticipated relationships to physician are actually to something else.  A medical system is as much art as science - at least in
    the USA.  Providers, plans, participants, terms, renewals, diagnosis codes, etc. make one's head spin.  Given that you have just started modeling, there is no reason at this point to make this choice - just be aware that the natural key poses some
    issues that you need to address at some point before completion.  Personally I would choose the natural key for now and let the model develop and demonstrate where this choice becomes a problem. 

  • Replacing natural keys with surrogate keys

    Hi,
    We have database that is runnig with some old applications since many years. In the database, all the primary key are natural keys (composed with many columns). The applications are developped with mod pl/sql and oracle forms6i / designer6i.
    We are planning to develop a new system (replacing all the old applications), the database tables will ramain the same but we are thinking about replacing the natural keys with surrogate keys. Since we are planning to develop and migrate into the new system gradually (oracle forms applications will not be redeveloped first), my question is:
    - will the oracle forms applications still works?
    - what is the risk and precautions to take ?
    - is the decision to convert natural keys into surrogate a good one?
    All your comments and propositions are welcome.
    Thanks.

    Surrogate keys in general is a good idea. Many generators cannot handle multiple column PK's very well, or not at all. I believe, for instance, that Apex can handle 2 columns only.
    But, doing this on an existing datamodel can be a lot of work. You have to change your tables, of course, but also the foreign keys, triggers, constraints etc. A PK is protected from an update, but I guess you also want your old, natural PK, to be protected as well.
    Forms generates master-detail synchronization based on FK relations. If these change, you may have to change your Forms too. As long as you don't do anything in your existing form, my guess is that it will still work. The forms will maintain the FK relation between old table definitions. This works independently of the actual FK relation in the database. You can create triggers on the tables to actually populate the new PK and FK.
    For something like this: give it a try in a small test setup first. Than calculate the risk and impact.

  • Could someone explain me about tools like "RICEF"

    Hi Guys,
    Could someone explain me about tools like "RICEF"(I dont know if iam spelling it correctly) and ASAP methodology. Iam wondering how this are related to SAP upgrade and fresh SAP implementation.
    Many thanks in advance.
    Warm Regards,
    Garrick.

    Hi
    It would be helpful to go through the help document of ASAP Methodology.
    The following information may clarify some doubts/requirements you have.
    Generating the Project IMG through ASAP:
    After you have set the project scope, the next step is to generate the Project IMG. From the Business Process Master List (BPML), you can directly access the IMG activities relevant for configuring each process.
    BPML: The Business Process Master List, along with the Business Blueprint, is a key result of the second phase of the Roadmap. Microsoft Excel tables contain the SAP scenarios, process groups, and processes that have been set in scope in the SAP Reference Structure, and are crucial for configuring your SAP System. In Realization, the third phase of the Roadmap, the BPML provides the basis for monitoring and steering test activities and for configuring your SAP System. It contains the titles of the structure items, and displays the status, the owner, links to documentation and links to the SAP System. Amongst other things, the BPML allows you to:
    1) Set your baseline and final scope. These are used for baseline and final configuration.
    2) Access the Project IMG and specific IMG activities assigned to structure items.
    3) Access integration test plans, which help you carry out all required integration tests.
    The Prerequisite is you have set the project scope.
    Process Flow to use the Business Blueprint as a basis for configuring your SAP System:
    1) Set the project scope.
    2) Generate the Project IMG.
    3) Generate the BPML.
    4) From a specific processes in the BPML, you can go to the relevant IMG activities and make Customizing settings.
    Hope this information provides information
    Check the following link for downloading the complete reference document on ASAP.
    http://help.sap.com/printdocu/core/print46b/en/data/en/pdf/SVASAP.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/SVASAQADBCBI/QADBCBI.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/SVASACCT/SVASACCT.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/SVASAPROZ/SVASAPROZ.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/SVASQADBS/Q&ADBSTRUCSTAN.pdf
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/SVASAPE/SVASAPE_01.pdf
    Regards

  • About Surrogate Key and Dimension Key on OWB 10.2

    Hi, everyone.
    I am using OWB 10.2 and I have a question about Surrogate key and Dimension Key.
    I indicated the foreign key as VARCHAR2 type in Fact Table and Dimension Key as VARCHAR2 type is operated as Primary key in Dimension Table. I made Single Level in Dimension Table.
    I know that Dimension Key stores the surrogate ID for dimension and is the primary key of the table. Also, Surrogate ID should be only NUMBER type.
    So, in this case, Surrogate ID is NUMBER type
    Dimension key should be NUMBER type to store the surrogate ID.
    But, Dimension key also should operate the primary to relate Foreign key as VARCHAR2 type.
    How I can solve this confusing condition?
    Please let me know that.
    JWS

    Hi JWS,
    From a SQL point of view it should not be a problem to join a NUMBER field to a VARCHAR2 field because during execution there will be an implicite cast for the NUMBER value to a VARCHAR2 value. See the example below.
       SELECT * FROM DUAL
       WHERE   1 = '1'From an OWB point of view it is not possible to have a Dimension with an NUMBER value Key that has a relation to a VARCHAR2 value Foreign key in a Fact table. This is caused due to the creation of a Fact table in OWB in which the Foreign keys in it are build from de Dimension tables that refer to them.
    You will loose the reference to the Dimension when changing the type of the Foreign Key.
    To resolve this issue I would advise you to use a Sequence that generates your Surrogate Key (NUMBER type) for the Dimension table and store it in the Primary Key Column (VARCHAR2 type).
    When validating the mapping you will get a warning, but when executing this should give no problems.
    Regards,
    Ilona

  • Explain me about cost in explain plan.

    Hi All,
    Please explain me about cost in explain plan.
    Below is my explan plans
    1. first plan showing cost is more but query is returing the result very fast (564 msecs ) --- local database.
    2. second plan showing less cost but result is very slow (14 secs) .
    1. local database.
    PLAN_TABLE_OUTPUT 
    | ID  | Operation                         | NAME                      | ROWS  | Bytes | COST  |
    |   0 | SELECT STATEMENT                  |                           |    17 |  2312 |    60 |
    |   1 |  SORT UNIQUE                      |                           |    17 |  2312 |    59 |
    |   2 |   COUNT STOPKEY                   |                           |       |       |       |
    |   3 |    NESTED LOOPS                   |                           |    17 |  2312 |    58 |
    |   4 |     MAT_VIEW ACCESS BY INDEX ROWID| MV_EDECO_ESONGS           |    17 |  1326 |    24 |
    |   5 |      INDEX RANGE SCAN             | IDX_ESNG_REG_TITLE        |    21 |       |     3 |
    |   6 |     TABLE ACCESS BY INDEX ROWID   | MV_EDECO_ESONGS_TERR_CTRY |     1 |    58 |     2 |
    |   7 |      INDEX UNIQUE SCAN            | IDX_ESNG_TERR_ESNG_ID_1   |     1 |       |     1 |
    PLAN_TABLE_OUTPUT
    | ID  | Operation                         | NAME                       | ROWS  | Bytes | COST  |
    |   0 | SELECT STATEMENT                  |                            |     9 |  1260 |    34 |
    |   1 |  SORT UNIQUE                      |                            |     9 |  1260 |    33 |
    |   2 |   COUNT STOPKEY                   |                            |       |       |       |
    |   3 |    NESTED LOOPS                   |                            |     9 |  1260 |    32 |
    |   4 |     MAT_VIEW ACCESS BY INDEX ROWID| MV_EDECO_ESONGS            |     9 |   720 |    14 |
    |   5 |      INDEX RANGE SCAN             | IDX_ESNG_REG_TITLE         |    11 |       |     3 |
    |   6 |     MAT_VIEW ACCESS BY INDEX ROWID| MV_EDECO_ESONGS_TERR_CTRY  |     1 |    60 |     2 |
    |   7 |      INDEX UNIQUE SCAN            | PK_EDESONGSTERCTRY_ESONGID |     1 |       |     1 |
    ------------------------------------------------------------------------------------------------Regards,
    Rajasekhar

    rajasekhar_n wrote:
    Hoek, I have cross checked the results both the querys are precessing same records and returing same result *(both are using DB links).*But you said the first query was on a local database?
    If you're using dblinks then it's not local is it! ?:|

  • Urgent expalantion reqired about foreign keys

    we are doing data migration project and we have get data from different regions data in flat files, but we have problem below like:
    i am facing a problem to declare unique constraints, because in some files column should be in number data type and same file from some other region is varchar2 but these two columns are unique ,these two columns don't having the any duplicate values.
    can i take this column data type in varchar2?
    why because if i am taking number type it cant accept varchar2
    any suggestions.................
    Regards,
    sh

    sh wrote:
    we are doing data migration project and we have get data from different regions data in flat files, but we have problem below like:
    i am facing a problem to declare unique constraints, because in some files column should be in number data type and same file from some other region is varchar2 but these two columns are unique ,these two columns don't having the any duplicate values.
    can i take this column data type in varchar2?
    why because if i am taking number type it cant accept varchar2
    any suggestions.................
    Regards,
    shNot really sure i understand your question. If you have 2 data sources and 2 different data types for the same type of data then you'd want to ensure you do a TO_NUMBER on the character representation of the data to ensure you strip out any non-printing characters like tabs or spaces.
    If that's not your problem, please try to be a little more clear. Your subject mentions you have an urgent problem about foreign keys and i find nothing to support your claim of urgency, nor foreign keys, within the subject of your question.
    Cheers,

  • Hi gurus, can any one explain me about patches in SAP?

    Hi gurus,
    Can any one explain me about patches in SAP?
    Regards
    Raghu

    Hi Raghu,
    If you do bit of googleing you will get information.
    http://help.sap.com/saphelp_smehp1/helpdata/en/30/1fea80d9b44f5a88fc0038d3dabb76/content.htm
    http://help.sap.com/saphelp_smehp1/helpdata/en/57/4e0eb0eae6457ea69b509813048989/content.htm
    http://help.sap.com/saphelp_nwce10/helpdata/en/a8/02784278b66255e10000000a155106/content.htm
    http://www.saptechies.com/support-package-stack-guide-sap-netweaver-70/
    http://www.sapdev.co.uk/upgrade/sap-patching.htm
    http://www.erpgreat.com/basis/sap-patch-administration.htm
    Regards,
    Deepanshu Sharma

  • Can any one explain me about bursting in bi publisher

    hi all
    can any one explain me about bursting in bi publisher
    i need with small example with screen shots
    Thanks
    Sreedhar

    Hi,
    http://blogs.oracle.com/BIDeveloper/2009/03/bursting_1.html
    look into this http://www.strsoftware.com/blogs/oracle/2009/12/how-to-burst-and-deliver-documents-from-bi-publisher-enterprise/
    Thanks,
    Srikanth

  • Hi gurus, can any one explain me about Badi & Bapi with eg.?

    Hi gurus,
    Can any one explain me about Badi & Bapi with examples.
    Regards
    Raghu

    Hi Raghu
    1) Badis means:
    The BAdIs of the enhancement concept are not treated as standalone objects, but are integrated in the overall concept. Thus, the tools for defining BAdIs are part of the Enhancement Builder included in the ABAP Workbench.
    Transaction SE18, up to now the only entry point for defining classic BAdIs, now manages classic and new BAdIs. When an existing BAdI is displayed or changed, it analyzes whether the BAdI is a classic or a new one, and then switches to the respective tool. In the case of a new BAdI, this tool is the enhancement spot editor
    2) Bapis means:
    BAPIs can be called within the R/3 System from external application systems and other programs. BAPIs are the communication standard for business applications. BAPI interface technology forms the basis for the following developments:
    Connecting:
    New R/3 components, for example, Advanced Planner and Optimizer (APO) and Business Information Warehouse (BW).
    Non-SAP software
    Legacy systems
    Isolating components within the R/3 System in the context of Business Framework
    Distributed R/3 scenarios with asynchronous connections using Application Link Enabling (ALE)
    Connecting R/3 Systems to the Internet using Internet Application Components (IACs)
    PC programs as frontends to the R/3 System, for example, Visual Basic (Microsoft) or Visual Age for Java (IBM).
    Workflow applications that extend beyond system boundaries
    Customers' and partners' own developments
    Thanks
    Trinath

  • Hi Folks, Can anyone explain me about below outputs

    Hi Folks, Can anyone explain me about below outputs
    sh processes cpu-hog
    Process:      ssm4ge_cfg_poll_thread, NUMHOG: 7, MAXHOG: 4100, LASTHOG: 790
    LASTHOG At:   15:21:47 UTC Apr 20 2013
    PC:           10ee46b
    Traceback:    1101e6d  1102227  10eeb8d  c7fb5b  c9301e  c8d7c5  c91486
                  c93e55  c7f89a  11509f
    Process:      fover_FSM_thread, NUMHOG: 1, MAXHOG: 325, LASTHOG: 330
    LASTHOG At:   15:21:51 UTC Apr 20 2013
    PC:           10ee46b
    Traceback:    1101d4a  110247f  10eec1f  c7fb08  c92fee  c8d735  c8d87a
                  c8fdad  c92c29  c931a4  c78c03  c7e166  ad7440  671bc1

    Hello Ashish,
    Each process on the ASA should take the CPU for a period of time (while its being processed by the ASA).
    When a process does not release the CPU is when a CPU Hog is triggered,
    In this case you can see 2 proceses that hold the CPU longer than they should ( you should see a cpu hog threshold value)
    In this case the first process has holded the CPU for 7 times ( the longest time being 4100 miliseconds)
    Remember to rate all of the helpful posts.
    For this community that's as important as a thanks

  • Can anybody send or explain me about GEM (Global Employee Management) Urge

    Hi,
    Can anybody send the document or explain me about GEM (Global Employee Management),
    It is bit urgent.
    Thanks in advance
    swamy
    7045000187

    Lol!
    I didn't see post until now...Not sure if you received the response yet...
    MGE is a subset or submodule of CE.
    CE concept is more align with and more import if you use SAP Payroll and Time. CE is concurrent employment where a person holds more than one position at a time in the same country.
    MGE is management global employee. Where a person move from one position to another during a duration to do an assignment. Upon completing the assignment, the person could localize there or return home.
    PNP and PNPCE. PNP is being discontinued and is replaced by PNPCE. The main difference between the two is PNPCE support the PERSON ID concept. Which is the unique identifier for an employee. It would be best to use PNPCE with MGE as you need that PERSON ID in the HR Report Category.
    Kevin T. Nguyen-Tu
    www.saphelpbykevin.com

  • Could you explain me about TEDS sensor section from NI9233?

    hi
          here is the TEDS sensor part's pic from NI 9233 getting started .Could you explain me about this part ? what does it support to do ?
    thank you
    roxy

    Hi Roxylat,
    TEDS is a compact set of data describing transducer characteristics. This link will give you more information on what a TEDS sensor is and how it works. Hope this helps.
    Ipshita C. 
    National Instruments
    Applications Engineer

  • Please explain me about  SDM & JSPM

    Hi Experts
    please explain me about  SDM & JSPM,
    what is diffrence between SDM & JSPM and why we use both tools.
    please provide me any documents or any links about SDM & JSPM.
    Regards
    BANDLA

    Dear Kondalu,
    SDM & JSPM are used to manage support packs in Java stack, As of SPAM in Abap stack.
    SDM was used in versions 3.0
    Find the link
    http://help.sap.com/saphelp_nw04/helpdata/en/63/2c4f65a54c4a4db1a3600397ae617f/content.htm
    JSPM is used from 7.0 and above.
    Java Support Package Manager is a software deployment tool that can be used for installing business packages, software components, and SAP kernel binaries.
    Java Support Package Manager can be used for the following:
    u2022 Installing support package stacks for existing software components
    u2022 Installing support packages for existing software components
    u2022 Installing or upgrading business packages
    u2022 Updating SAP kernel binaries, Software Delivery Manager (SDM), and Internet Graphics Service (IGS)
    u2022 Self-updating Java Support Package Manager so that the latest version is used
    u2022 Deploying new SAP and non-SAP software components
    u2022 Installing additional usage types such as Enterprise Portal (EP) or Process Integration (PI)
    Regards
    Injamuri

Maybe you are looking for

  • Why is it a shared folder in the music app and why do i need internet to listen to it?

    why is it a shared folder in the music app and why do i need internet to listen to it?

  • IPhone & iTunes - cutting music short

    Looking to fix my iPhone iTunes - it will randomly stop playing music or switch to the next song before the current one is over.  I have seen hundreds of posts about this from users but absolutely nothing from Apple on this issue.  Honestly, I don't

  • How to read environment variable

    How do I read an environment variable within TS? I was thinking of calling getenv("VARIABLE_NAME") except it returns a char * and TS only allows Boolean or Numeric return type. I wonder if LV has any function for doing the same thing. 

  • Playing MP4 videos on 4400 dmp

    Hi, it looks like MP4 is a supported file type -- at least in the media library on the DMM.  But, the videos do not play, all I get is a blank screen.  any suggestions? Rose Ann

  • Hiding App Icons That Are Currently Running

    Hello everyone, I hope you are all doing well. I'm having an issue with a rather stubborn app that is sitting in my Dock. About 2 months ago I bought myself a Genius Writing Tablet for my Macbook. Sadly, the thing has a really annoying driver app cal