Loading ...
Sorry, an error occurred while loading the content.
 

Database related

Expand Messages
  • rafiq sohel
    Hello, I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for
    Message 1 of 6 , Jan 2, 2012
      Hello,

      I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for curiosity, which of the followings is the best practice:
      1. Store all data in a single table and access them by using column names whenever required.
      2. Instead of single table those are kept into multiple tables - keeping them connected with a primary key, depending on the usage.

      ** I practice the second method.
       
      Regards,

      Md. Rafiqul Islam
      GMG Airlines Ltd.

    • Saiful Islam
      Hello Md. Rafiqul Islam Practicing the second method is good and perfect. Extracting a large table in to many table is called Database Normalization. Well
      Message 2 of 6 , Jan 2, 2012
        Hello Md. Rafiqul Islam

        Practicing  the second method is good and perfect.

        Extracting a large table in to many table is called Database Normalization.

        Well normalization reduce data redundancy. 
        --
        Saiful Islam
        Gazipur, Bangladesh
        http://saifulbd.com/



        On Mon, Jan 2, 2012 at 5:36 PM, rafiq sohel <rafiq7s@...> wrote:
         

        Hello,

        I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for curiosity, which of the followings is the best practice:
        1. Store all data in a single table and access them by using column names whenever required.
        2. Instead of single table those are kept into multiple tables - keeping them connected with a primary key, depending on the usage.

        ** I practice the second method.
         
        Regards,

        Md. Rafiqul Islam
        GMG Airlines Ltd.


      • ymnoor21
        Dear Rafiqul bro, The process that you follow is called normalization. There are couple of normalization forms 1NF, 2NF, 3NF, BCNF (Boyce Codd). I agree that
        Message 3 of 6 , Jan 2, 2012
          Dear Rafiqul bro,
          The process that you follow is called normalization. There are couple of normalization forms 1NF, 2NF, 3NF, BCNF (Boyce Codd). I agree that 95% of the time it is good to have normalization done for the database, however sometimes not. So be sure to check this following items before doing database normalization:

          1. Dont break gigantic table tons of tables (ex: 10+ tables, eventually becomes hard to track if no table name convention followed). Break it upto what it makes sense.

          2. Misunderstanding of MySQL Engine type. Lot of our folks don't know that MySQL has heap / memory table (apart from MyISAM / InnoDB Engine) which can be very very good performance booster. Be careful, memory table do not allow text datatype columns, also it is meant to get empty when the machine hosting MySQL gets restarted. So its something like caching. Although you can treat it like a real table.

          3. Ignorance for choosing datatype. If you know that the number / text that you are going to store in a table is not going to exceed some certain limit, then please choose datatype according to it. Such as 'varchar' over 'char', 'smallint' over 'int' and vice versa.

          4. VIEWS are only useful when you access its content all together, not as a single row.

          5. Use MySQL Workbench software for designing your schema / model and save it for future reference.

          Thanks
          Yamin

          --- In phpexperts@yahoogroups.com, rafiq sohel <rafiq7s@...> wrote:
          >
          > Hello,
          >
          >
          > I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for curiosity, which of the followings is the best practice:
          > 1. Store all data in a single table and access them by using column names whenever required.
          > 2. Instead of single table those are kept into multiple tables - keeping them connected with a primary key, depending on the usage.
          >
          > ** I practice the second method.
          >
          >  
          > Regards,
          >
          > Md. Rafiqul Islam
          > GMG Airlines Ltd.
          >
        • rafiq sohel
          Yes, to use of multiple tables instead of one is to practice normalization, and its good practice indeed. Actually i was thinking about data-access time, if it
          Message 4 of 6 , Jan 2, 2012
            Yes, to use of multiple tables instead of one is to practice normalization, and its good practice indeed.

            Actually i was thinking about data-access time, if it is feasible for normalization - having lots of data in the table. And this was my point of view. I am sorry, I was not so clear in my previous mail.


            From: Saiful Islam <abssaiful@...>
            To: phpexperts@yahoogroups.com
            Sent: Monday, 2 January 2012 8:33 PM
            Subject: Re: [phpXperts] Database related

             
            Hello Md. Rafiqul Islam

            Practicing  the second method is good and perfect.

            Extracting a large table in to many table is called Database Normalization.

            Well normalization reduce data redundancy. 
            --
            Saiful Islam
            Gazipur, Bangladesh
            http://saifulbd.com/



            On Mon, Jan 2, 2012 at 5:36 PM, rafiq sohel <rafiq7s@...> wrote:
             
            Hello,

            I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for curiosity, which of the followings is the best practice:
            1. Store all data in a single table and access them by using column names whenever required.
            2. Instead of single table those are kept into multiple tables - keeping them connected with a primary key, depending on the usage.

            ** I practice the second method.
             
            Regards,

            Md. Rafiqul Islam
            GMG Airlines Ltd.




          • it.codeperl
            It depends on the relations of your entities, i think. If they have relations needed by the application requirement, it will be better to store those data in
            Message 5 of 6 , Jan 2, 2012
              It depends on the relations of your entities, i think. If they have relations needed by the application requirement, it will be better to store those data in multiple tables.Otherwise, you can put them in the same DB Table.

              --- In phpexperts@yahoogroups.com, rafiq sohel <rafiq7s@...> wrote:
              >
              > Hello,
              >
              >
              > I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for curiosity, which of the followings is the best practice:
              > 1. Store all data in a single table and access them by using column names whenever required.
              > 2. Instead of single table those are kept into multiple tables - keeping them connected with a primary key, depending on the usage.
              >
              > ** I practice the second method.
              >
              >  
              > Regards,
              >
              > Md. Rafiqul Islam
              > GMG Airlines Ltd.
              >
            • Saiful Islam
              Actually access of data from those tables one to one, one to many, many to many or many to one takes more or less same time as our aspect. may have differ from
              Message 6 of 6 , Jan 2, 2012
                Actually access of data from those tables one to one, one to many, many to many or many to one takes more or less same time as our aspect. may have differ from one to another micro second.

                But complex queries are different issue.

                Normalization helps us to manage our tables easier, no redundant data and so.
                 
                --
                Saiful Islam
                Gazipur, Bangladesh
                http://saifulbd.com/



                On Tue, Jan 3, 2012 at 12:36 AM, rafiq sohel <rafiq7s@...> wrote:
                 

                Yes, to use of multiple tables instead of one is to practice normalization, and its good practice indeed.

                Actually i was thinking about data-access time, if it is feasible for normalization - having lots of data in the table. And this was my point of view. I am sorry, I was not so clear in my previous mail.


                From: Saiful Islam <abssaiful@...>
                To: phpexperts@yahoogroups.com
                Sent: Monday, 2 January 2012 8:33 PM
                Subject: Re: [phpXperts] Database related

                 
                Hello Md. Rafiqul Islam

                Practicing  the second method is good and perfect.

                Extracting a large table in to many table is called Database Normalization.

                Well normalization reduce data redundancy. 
                --
                Saiful Islam
                Gazipur, Bangladesh
                http://saifulbd.com/



                On Mon, Jan 2, 2012 at 5:36 PM, rafiq sohel <rafiq7s@...> wrote:
                 
                Hello,

                I have to store information containing 30 or more data. 10 of among them need to access frequently and others are rarely. I want to know, just for curiosity, which of the followings is the best practice:
                1. Store all data in a single table and access them by using column names whenever required.
                2. Instead of single table those are kept into multiple tables - keeping them connected with a primary key, depending on the usage.

                ** I practice the second method.
                 
                Regards,

                Md. Rafiqul Islam
                GMG Airlines Ltd.





              Your message has been successfully submitted and would be delivered to recipients shortly.