Web site directory

In the following example, we use the car_free_field table to store unplanned information about the car whose internal_number is 412. The weight and special paint had not been planned, so the UI gave the user the chance to specify which information they want to keep, and the corresponding value. We see here a screenshot from phpMyAdmin but most probably, another UI would be presented to the user for example the salesperson who might not be trained to play at the database level. CREATE TABLE `car_free_field` ( `internal_number` int(11) NOT NULL, `free_name` varchar(30) NOT NULL, `free_value` varchar(30) NOT NULL, PRIMARY KEY (’internal_number’,'free_name’) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `car_free_field` VALUES (412, ‘weight’, ‘2000′); INSERT INTO `car_free_field` VALUES (412, ’special paint needed’, ‘gold’); Pitfalls of the Free Fields Technique Even if it’s tempting to use this kind of table for added flexibility and to avoid user interface maintenance, there are a number of reasons why we should avoid using it. It becomes impossible to link this “column” (for example the special paint needed) to a lookup table containing the possible colors, with a foreign key constraint.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services

Leave a Reply