Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Chad Lee
  Where is Chad Lee?
 Marshall
 Texas - United States
 Chad Lee
 To: Ammar Hadi
  Where is Ammar Hadi?
 Al-Samawah
 Iraq
 Ammar Hadi
 Tags
Subject: RE: Need help with Distinct or Group By
Thread ID: 228143 Message ID: 228424 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Monday, May 18, 2009 8:01:01 PM         
   


> > There are 80 fields in my original table, and I would need all 80 fields to be copied for each row.
>
> Hi Chad,
>
> Jon and Stefan did a great job and gave you the answer.
> I just want to be sure that you are going in the write way in designing your database.
> You have a table with 80 fields?? isn't that too much.
> usually in such cases, you will get redundant data that will consume more space in the hard drive and when loaded into the RAM and will not get the full benefit from the great invention: the relational database.
> What I want to point to is that you should try to find where you can make parent and child tables out of your 80 fields table.
> with the growth of data in this table your application will be compromised especially if you run it in a network environment.
>
> From the data you gave above, you can see that Bill Jone is repeated several times, John Jone is repeated several times. Radio is repeated several times.
> This is a great loss in the file size and you may even go out of space (I mean the table size .. the limit is 2GB). But the main problem is the non-optimum data managment that you will experiment.
>
> You better create a table for customer names like Customers (cust_id_pk i, fName c(20, lName c(20)) and for items like items(it_id_pk i, it_name c(20)).
> In this case you will not need to have fname,lname and item fields. Instead you put these fields: (cust_id_fk i) and (it_id_fk i), so that you will just insert the Id of the customer and the id of the item s/he purchased. review the other fields and do the same. Create more tables rather than more fields in one table.
>
> I think you will get benefit from reading about the proper design of databases. There are articles about that here in foxite and in the help of foxpro.
>
> Best regards
>
> Ammar Hadi ................IRAQ
>
> My Foxite Weblog
>
> ---------------
> I I I really love foxite
> ___________________________

Hi Ammar. I agree with your observation. When I create a program I do exactly what you suggest, I stick with simplicity. This system has been in place over 14 or so years and these tables are for each order. The customer uses our software to make an order and then they upload the order which is the table. It is used to import the order. They are then dissected in the import program. It is a free table that holds order information and may be called in 3 or 4 other programs along it's way through our lab. Then it is never used again unless there is a problem, just backed up.

80 fields makes it hard to type out a SELECT.

ENTIRE THREAD

Need help with Distinct or Group By Posted by Chad Lee @ 5/15/2009 8:58:29 PM
RE: Need help with Distinct or Group By Posted by Jon Goad @ 5/15/2009 9:09:19 PM
RE: Need help with Distinct or Group By Posted by Chad Lee @ 5/15/2009 10:25:21 PM
RE: Need help with Distinct or Group By Posted by Stefan Wuebbe @ 5/15/2009 10:37:35 PM
RE: Need help with Distinct or Group By Posted by Chad Lee @ 5/15/2009 10:54:19 PM
RE: Need help with Distinct or Group By Posted by Ammar Hadi @ 5/16/2009 12:11:03 AM
RE: Need help with Distinct or Group By Posted by Chad Lee @ 5/18/2009 8:01:01 PM
RE: Need help with Distinct or Group By Posted by Ammar Hadi @ 5/18/2009 8:32:33 PM
RE: Need help with Distinct or Group By Posted by Anders Altberg @ 5/16/2009 12:54:00 AM
RE: Need help with Distinct or Group By Posted by Chad Lee @ 5/18/2009 8:03:10 PM