SaranacLake Posted May 8, 2020 Share Posted May 8, 2020 Is it necessary to have the units of measurement in a column name? I want to add the column "contract_term" to my table, but it will store things in terms of MONTHS, so an annual membership would have a value of 12. (This is easier than needing a second column for units or dealing with decimals.) I could have "contract_term_mths" but that sorta looks weird. Thoughts? Quote Link to comment Share on other sites More sharing options...
benanamen Posted May 8, 2020 Share Posted May 8, 2020 (edited) Seems to me it would be better to have contract_start and contract_end date columns. If you will be needing historical data then you would have a table for storing each term start/end dates keyed to the user_id. You will also gain a lot of flexibility with being able to do date calculations and Analytics. Edited May 8, 2020 by benanamen Quote Link to comment Share on other sites More sharing options...
SaranacLake Posted May 8, 2020 Author Share Posted May 8, 2020 23 minutes ago, benanamen said: Seems to me it would be better to have contract_start and contract_end date columns. If you will be needing historical data then you would have a table for storing each term start/end dates keyed to the user_id. You will also gain a lot of flexibility with being able to do date calculations and Analytics. Wrong concept. Not the start and end date of a specific contract. The term of a generic contract. Think "annual subscription", "one-month trial", etc. Quote Link to comment Share on other sites More sharing options...
benanamen Posted May 8, 2020 Share Posted May 8, 2020 (edited) Ok, so a subscription _ types lookup table with subscription_type_id, subscription_type_description Then in data table you have subscription_type_id keyed to the lookup table. Edited May 8, 2020 by benanamen Quote Link to comment Share on other sites More sharing options...
SaranacLake Posted May 8, 2020 Author Share Posted May 8, 2020 4 minutes ago, benanamen said: Ok, so a subscription _ types lookup table with subscription_type_id, subscription_type_description Then in data table you have subscription_type_id keyed to the lookup table. Why do you do this? I ask a specific question, and now you are giving me data modeling lessons? Stop twisting what I asked for into something it's not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.