![]() | |
#31
| |||
| |||
|
|
On Net writes Nullable columns take me back to the dawn of my computing career, where the use of rogue/special values took the place of nulls and that is a very bad thing. How many ingres developers have text columns populated with spaces that logically should be nulls? Yes, it reminds me of a sales application which stores detail, subtotals and grand totals for region, state, month and year all in the same table using marker values for the totals. The unique primary keys are like this. 2011 01 VIC V1 2011 02 VIC V1 2011 01 VIC V2 2011 02 VIC V2 2011 01 NSW N1 . 2011 0 VIC V1 2011 0 VIC V2 . 2011 0 NSW ** . 2011 0 *** ** The design is intended to provide fast response to common selection criteria in a sales enquiry screen. Eg Total sales for VIC by month, or Sales by state for 2011. Overnight batch processing recalculates the summary entries as part of sales update. I found the design appealing because of the simplicity of the schema and the ease of construction of the SQL statements with optional grouping/totalling. In hindsight I see NULL could be used instead of marker values for the subtotals, so it would seem legitimate that the primary key would be unique with nullable key parts. Paul White |
#32
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |