August 27th, 1999, 03:17 PM
I am curious as to how people have designed their databases. Initial design is important, but havenít seen anywhere that has good examples as to types, sizes, indexes, and keys used on columns of a table.
I think it would be interesting and informative to see what others use for their databases, and/or links to good resources on database design.
Specifically, on a customer table: What size do you make an email field? (I've seen VARCHAR(25) used, but my email is longer than that) What items have you indexed and used as a primary key?
August 29th, 1999, 02:26 AM
I've tended to make my e-mail fields varchar(64) as this seems to take care of pretty much everything.
In general, to make things fast and safe. You want to make indexes on any field that will appear in the WHERE and ORDER parts of your SQL query.
I've also indexed my ID field and made it auto-increment. Current versions of MySQL however do not manage unique auto-increment numbers properly, so this is something to watch out for, if you have to delete records at some point.
Generally, any SQL book is a good source. I learned a lot on the subject by reading Miriam Liskin's books on Foxpro and Access some years earlier. I've found that her explanations and rationaly on data definitions to be unsurpassed.
[This message has been edited by esconsult1 (edited 08-29-99).]
August 30th, 1999, 06:19 PM
I think database design is much more complex for a relational database. MS Access is such a database. Look for the "Building Applications" booklet that comes with MS Access (2.0, 95, or 97).
September 1st, 1999, 02:48 PM
If you'd like a terrific book on database design, check out Database Design for Mere Mortals by Michael Hernandez.