ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Excel to SQL - Need Some Normalization Tips

    IT Discussion
    3
    19
    1.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JaredBuschJ
      JaredBusch @garak0410
      last edited by

      @garak0410 said in Excel to SQL - Need Some Normalization Tips:

      So, what I am looking for is the proper way to store these notes in a database and have it tie back to the matching customer. I've imported this into SQL and while it worked, I still have the problem of how to display the data from the columns. Management stills wants one large field that displays the notes, most likely with a vertical scroll bar to through through them.

      Do not worry about how to store the data.
      Start with what you need to end up with and how it will be entered.
      Those are two different things.
      But those two will form the basis for what your data will have to be.

      So supposing you have these entry fields.

      • ID
      • Customer (multiple fields for info, name, account #, etc.)
      • Note 1
      • Note 2
      • Note 3

      You were posting about making multiple tables and getting close to 3rd normal form.

      Works great, and is good design of course, but you also need to think about the purpose of this application.

      But do you need to get that complicated? Any relational database can take all that in a single table with as many columns as needed.

      scottalanmillerS garak0410G 2 Replies Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller @JaredBusch
        last edited by

        @JaredBusch said in Excel to SQL - Need Some Normalization Tips:

        Any relational database can take all that in a single table with as many columns as needed.

        As will non-relational. Pretty much the sky is the limit here.

        1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          Seems like the display is really the tough part. Maybe start with a MOCK UP of the display and work backwards from there.

          1 Reply Last reply Reply Quote 1
          • garak0410G
            garak0410
            last edited by

            Yeah, the number one goal for management/end users is just something that is NOT EXCEL. Web-Based is what they want but it is limited on my (current) dev knowledge. Access would work for now for sure but not what I would choose. I used to really like LightSwitch but it is on the route of depreciation.

            I think I am on the right track as far as forming the database but need something that will store and display these notes in correct database normalization.

            JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 0
            • JaredBuschJ
              JaredBusch @garak0410
              last edited by JaredBusch

              @garak0410 said in Excel to SQL - Need Some Normalization Tips:

              Yeah, the number one goal for management/end users is just something that is NOT EXCEL. Web-Based is what they want but it is limited on my (current) dev knowledge. Access would work for now for sure but not what I would choose. I used to really like LightSwitch but it is on the route of depreciation.

              I think I am on the right track as far as forming the database but need something that will store and display these notes in correct database normalization.

              normalizing the notes into a separate table means they will look like this

              • ID
              • CustID (foreign key to Customer tbale)
              • NoteNo (ie note 1, 2, 3, 4)
              • NoteText
              garak0410G 1 Reply Last reply Reply Quote 2
              • garak0410G
                garak0410 @JaredBusch
                last edited by

                @JaredBusch said in Excel to SQL - Need Some Normalization Tips:

                @garak0410 said in Excel to SQL - Need Some Normalization Tips:

                Yeah, the number one goal for management/end users is just something that is NOT EXCEL. Web-Based is what they want but it is limited on my (current) dev knowledge. Access would work for now for sure but not what I would choose. I used to really like LightSwitch but it is on the route of depreciation.

                I think I am on the right track as far as forming the database but need something that will store and display these notes in correct database normalization.

                normalizing the notes into a separate table means they will look like this

                • ID
                • CustID (foreign key to Customer tbale)
                • NoteNo (ie note 1, 2, 3, 4)
                • NoteText

                I am visualizing that now...thanks...

                JaredBuschJ 1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @garak0410
                  last edited by JaredBusch

                  @garak0410 said in Excel to SQL - Need Some Normalization Tips:

                  @JaredBusch said in Excel to SQL - Need Some Normalization Tips:

                  @garak0410 said in Excel to SQL - Need Some Normalization Tips:

                  Yeah, the number one goal for management/end users is just something that is NOT EXCEL. Web-Based is what they want but it is limited on my (current) dev knowledge. Access would work for now for sure but not what I would choose. I used to really like LightSwitch but it is on the route of depreciation.

                  I think I am on the right track as far as forming the database but need something that will store and display these notes in correct database normalization.

                  normalizing the notes into a separate table means they will look like this

                  • ID
                  • CustID (foreign key to Customer tbale)
                  • NoteNo (ie note 1, 2, 3, 4)
                  • NoteText

                  I am visualizing that now...thanks...

                  The only hard part is deciding where to loop or pivot the data. That depnds on how you end up designing things IMO. Sometimes SQL is better, sometimes your app is better to handle that.

                  SELECT c.CustID, c.CustInfo(muliple colmuns), n.NoteNo,n.NoteText
                  FROM Customer AS c
                      LEFT JOIN Notes AS n ON n.CustID = c.ID
                  WHERE c.id = $INPUTFROMWEBFORM
                  

                  This would dump it all out in 3 rows with the customer data repeated each time. Handle looping it out in your web app.

                  You could conversely write a loop or pivot in SQL to make it all come out on one line.

                  Or you could make 2 calls to the DB once for the customer data and once for the notes.

                  Really up to you. Whatever is easier for you.

                  1 Reply Last reply Reply Quote 2
                  • scottalanmillerS
                    scottalanmiller @garak0410
                    last edited by

                    @garak0410 said in Excel to SQL - Need Some Normalization Tips:

                    Yeah, the number one goal for management/end users is just something that is NOT EXCEL. Web-Based is what they want but it is limited on my (current) dev knowledge. Access would work for now for sure but not what I would choose. I used to really like LightSwitch but it is on the route of depreciation.

                    I think I am on the right track as far as forming the database but need something that will store and display these notes in correct database normalization.

                    Look at the Meteor.js tutorials. I think you may find everything you need in the tutorial example alone.

                    1 Reply Last reply Reply Quote 1
                    • scottalanmillerS
                      scottalanmiller
                      last edited by

                      https://www.meteor.com/tutorials

                      1 Reply Last reply Reply Quote 1
                      • garak0410G
                        garak0410 @JaredBusch
                        last edited by

                        @JaredBusch said in Excel to SQL - Need Some Normalization Tips:

                        @garak0410 said in Excel to SQL - Need Some Normalization Tips:

                        So, what I am looking for is the proper way to store these notes in a database and have it tie back to the matching customer. I've imported this into SQL and while it worked, I still have the problem of how to display the data from the columns. Management stills wants one large field that displays the notes, most likely with a vertical scroll bar to through through them.

                        Do not worry about how to store the data.
                        Start with what you need to end up with and how it will be entered.
                        Those are two different things.
                        But those two will form the basis for what your data will have to be.

                        So supposing you have these entry fields.

                        • ID
                        • Customer (multiple fields for info, name, account #, etc.)
                        • Note 1
                        • Note 2
                        • Note 3

                        You were posting about making multiple tables and getting close to 3rd normal form.

                        Works great, and is good design of course, but you also need to think about the purpose of this application.

                        But do you need to get that complicated? Any relational database can take all that in a single table with as many columns as needed.

                        The purpose is to see what special requirements there are for certain customers. We currently have 145 regular customers who have special needs when we design a building for them. We want to be able to display the customers in a cleaner format and also make it easy for a designated person to update as needed.

                        And I am, for now, going to use Access because I need something quick and within my current skill level. And yes, when my skills expand, I do plan on redesigning this. The main problem I am having is displaying the notes. Each single note per customer is it's own field. For example, look at this wizard:

                        0_1489002763830_access02.jpg

                        In creating a form,. it's wants me to select each note field and ends up looking like this:

                        0_1489002881856_access03.jpg

                        This isn't want management wants and it will also cause problems for customers who need more than 16 "notes." They want to see the customer name, address, contact number and all notes associated with it. It would be nice to see all notes in a scrollable window. Not sure how easy that would be with Access but I'm thinking it would be. This is where I may be confused if I need normalization or not.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post