Reasons for database de-normalization

Consider this case, your site is an e-commerce site and your customer has placed and confirm an order. You don’t need to normalize this table because the data for this table should not be changed (edit or delete). This design provides two advantages: Data Integrity (Security). Changes of data in other tables will not affect Read more about Reasons for database de-normalization[…]

Convert DateTime Data Type

(This example was done using SQL Query Analyzer in SQL Server 2000) Say you have this table below, product_type log_datetime xbox 2008-06-11 16:26:46.000 xbox 2008-06-13 16:30:09.653 psp 2008-06-14 16:28:08.000 ps 2008-06-16 16:21:40.000 And you would like to display log_datetime in different format, how do you do it? One way is to do the formating at Read more about Convert DateTime Data Type[…]

One Resource Table

One Resource Table Using one resource table method is similar to many lookup tables. The difference is this one resource table actually combines all lookup tables by adding just one more field. Of course, this one resource table will be much larger because it combines all lookup tables. Using back the same lookup tables at Read more about One Resource Table[…]

Hardcoded Values vs Lookup Tables

Hardcoded Values You have a form, say, a registration form. In this form, you have these common fields, example Name, Age, Address, State, Country and etc. So, in your database design, how do you go about it? Create just one table to store all these fields? Something like below? ID Name Age Address State Present_Country Read more about Hardcoded Values vs Lookup Tables[…]