1

How do I name columns in my database tables which have the same name in outside world but are logically separated?

Lets say an example

Company Share:   100% of 50%

Now I have two company shares: 100 percent and 50 percent.

I could rename them as CompanyShare1, CompanyShare2 but programmers have a hard time understanding these names. Is there any tip on dealing with such scenarios?

Zo Has
  • 111
  • 3
  • Are you sure you don't need a separate companyshares table? – Philᵀᴹ Mar 31 '14 at 09:20
  • Yes, the percentage fields are fixed. Two for each row. – Zo Has Mar 31 '14 at 09:21
  • Let me ask this: Where it says 100%, what is it 100% of? Where it says 50%, what is it 50% of? – user1008646 Mar 31 '14 at 10:28
  • @user1008646 They are two share values. Means, 100 percent of 50 percent. Say I have an amount $10, its 50 percent is 5$ and 100 percent of 5$ is 5$ again. It is confusing in the fact that both these values represent the same share but have a different logical usage. – Zo Has Mar 31 '14 at 10:31
  • 2
    OK, but what ARE these things? You say "I have $10". What does that $10 represent? Then you take 50% of that. Yes, it's $5, but WHAT is it? If you can answer these questions, then you will have the answer to your original question. – user1008646 Mar 31 '14 at 10:36
  • @user1008646 $10 is the share amount and percentages are share percentage 1 & 2. – Zo Has Mar 31 '14 at 11:03
  • We're getting closer ... $10 is the share amount. Now fill in the blank. In our example, taking 50% of the share amount gives us the _________. And taking 100% of that in turn gives us the _________. – user1008646 Mar 31 '14 at 11:36
  • @user1008646 percentage1 and percentage2? Well I exactly tried that in the first place. Just the programming team does not get the 1, 2. It does not have a valid meaning to it :( – Zo Has Mar 31 '14 at 11:38
  • It must have a meaning. Let me ask you this, ... why is it expressed as two percentages? The company share is 100% of ______________, which in turn is 50% of the share amount. – user1008646 Mar 31 '14 at 11:48
  • 1
    I have a jar of marbles. Some are blue, some are red. Some are large, some are small. The jar has 100 marbles. How many are small blue marbles? Of the 100 marbles, 20% of them are blue. Of the blue marbles, 60% of them are small. There are 12 small blue marbles, which is 60% of the blue marbles, which are 20% of the marbles in the jar. I would call 60% the "size percentage", and the 20% I would call the "color percentage". I could just write 60% of 20%, but the percentages have meaning. – user1008646 Mar 31 '14 at 11:57

0 Answers0