2 Replies Latest reply: May 14, 2012 10:43 AM by rp0428 RSS

    Normalization Assistance!

    937035
      I am a newbie to Oracle SQL Developer. I need help in finding out how to normalize data from excel spreadsheet and then to create an entity relationship diagram after that. I have seen how to import the excel file column's, but my question is do I need to create a new table for each item such as city, state etc? There is data already inputed, but needs to be normalized I.E. 1NF, 2NF etc. Any help would be appreciated!
        • 1. Re: Normalization Assistance!
          Jim Smith
          Normalisation is not a technical issue, and is really nothing to do with SQL developer. It requires knowledge of the data and the business environment the data is intended to support.

          I suggest you find a text on normalisation (I'm sure there are plenty online), and follow it through with reference to you data.

          No one here can really help you. Do you need a relation for City? It depends on what you need to use the data for. If City is just part of an address, then probably not. If you need to store other information about cities you probably do. Only you can tell.
          • 2. Re: Normalization Assistance!
            rp0428
            Welcome to the forum!

            Whenever you post please provide the full version number of sql developer, platform and 4 digit Oracle version (result of SELECT * FROM V$VERSION).

            This question has components about normalization and entity relationships so it is a little fuzzy as to which forums might provide the best help.

            This forum might have some help for both aspects but I suggest you cross-post in the General Database forum at
            General Database Discussions

            NOTE: generally cross-posting is frowned on but in some cases it is appropriate. If you post this question in the other forum provide a link in this post to the other thread and vice versa. That way users can reference both threads easily. And if you like you may indicate that I suggested that you post in the other thread also; anyone that objects can direct they objections to me.
            >
            I need help in finding out how to normalize data from excel spreadsheet and then to create an entity relationship diagram after that. I have seen how to import the excel file column's, but my question is do I need to create a new table for each item such as city, state etc? There is data already inputed, but needs to be normalized I.E. 1NF, 2NF etc.
            >
            First, there doesn't seem to be a generally agreed upon definition of what the requirements for each normal form actually are.

            Second, not all tables need to be normalized to ANY of the forms. That statement will probably surprise some people.

            The following uses the wiki for discussion purposes but does not imply that those definitions are correct in all respects.
            http://en.wikipedia.org/wiki/First_normal_form
            http://en.wikipedia.org/wiki/Second_normal_form

            1NF, condition #3 says no duplicate rows. Then says
            >
            Examples of tables (or views) that would not meet this definition of 1NF are:

            A table that lacks a unique key. Such a table would be able to accommodate duplicate rows, in violation of condition 3.
            >
            But log tables that record sequential logging operations might contain duplicate rows so would not be 1NF.
            This could be technically mitigated by using a sequence number as a unique key but that doesn't really address the issue of the actual data being duplicated. So different authors have different opinions on whether that 'technical' correction actually converts the table to 1NF.

            Condition 4 says
            >
            Every row-and-column intersection contains exactly one value from the applicable domain (and nothing else).
            >
            and then goes on to say that a violation of this is
            >
            A table with at least one nullable attribute. A nullable attribute would be in violation of condition 4, which requires every field to contain exactly one value from its column's domain. It should be noted, however, that this aspect of condition 4 is controversial. It marks an important departure from Codd's later vision of the relational model,[6] which made explicit provision for nulls.[7]
            >
            In ALL systems I have worked on over a 20 year period I have rarely seen a table that did not have at least one nullable column. And note that the comment indicates that the nullable aspect is controversial.

            I while some basic normalization is good and appropriate it would be unreasonable and perhaps even unattainable to try to strictly implement any particular definition of the normal forms.

            For some use cases, OLAP data warehouses for example, some data items are intentionally de-normalized to improve performance. A requirement to normalize ALL data in ALL tables would be inadvisable.

            I suggest you review examples such as those in the wiki and implement the major areas of normalization shown in 1NF and 2NF before beginning entity relationship work.

            Then if you have specific questions provide your sample tables and data so we can try to reproduce the issue you are having.