|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
difference between relational table and flat field table
hi
can any one tell me the diffrerence between flat field table and relational table and the advantage and disadvantage of these two type of table any sources of inforamtion would be grateful |
|
#2
|
|||
|
|||
|
If you have a one-table database, it's called a flat table. If you use one table that is used to keep track of all of your customers and what they purchase from your store:
id first last address city state zip date item price Everytime a new row is inserted into the table, all columns will be be updated, thus resulting in unnecessary "redundant data". For example, every time Wolfgang Schultz purchases something, the following rows will be inserted into the table: id first last address city state zip date item price 10982 Wolfgang Schultz 300 N. 1st Ave Yuma AZ 85002 032299 snowboard 45.00 10982 Wolfgang Schultz 300 N. 1st Ave Yuma AZ 85002 082899 snow shovel 35.00 10982 Wolfgang Schultz 300 N. 1st Ave Yuma AZ 85002 091199 gloves 15.00 10982 Wolfgang Schultz 300 N. 1st Ave Yuma AZ 85002 100999 lantern 35.00 10982 Wolfgang Schultz 300 N. 1st Ave Yuma AZ 85002 022900 tent 85.00 Sweet redundancy action huh? An ideal database would have two tables, where they have relationships that bind them together: One for keeping track of your customers And the other to keep track of what they purchase: "Customer_info" table: customer_number firstname lastname address city state zip "Purchases" table: customer_number date item price Now, whenever a purchase is made from a repeating customer, the 2nd table, "Purchases" only needs to be updated. We've just eliminated useless redundant data, that is, we've just normalized this database Notice how each of the tables have a common "cusomer_number" column. This column, which contains the unique customer number will be used to JOIN the two tables. Using the two new tables, let's say you would like to select the customer's name, and items they've purchased. This is how they are relational, because they have something you can bind them together on. Advantages of Flat Table: I'm not really sure, easy to maintain? Everything is consolidated, which is i guess an advantage but not really..... |
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > difference between relational table and flat field table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|