I am new to this forum so this will be my first posting. I have read a lot and i gather there is two groups, one favouring surrogate keys and another that sees them as a necessary evil. I tend to agree that you should use natural keys as long as possible, only when you don't have one let the database or you yourself generate it programatically. But i have a few questions regarding naming convention and common practise.
1. Would you say that Id as a suffix is a naming convention for a identity column (auto generated by the database)
2. Have you ever had a solution where you had you own number series table, where each row represented some type of number series for example order numbers, invoice numbers etc?
For example:
Table NumberSeries
Id (user entered)
Name
Type
Start
Current
End
3. If you had some column used as primary key and you generated it yourself programmatically with a set of business rules, would you still call it a Id?
For example, if I generate something like this:
ADD12344GQ = orderNumber or orderId
and if you would have a new customer
Company offical name : The Great Company Ltd
and you either:
- generated key programatically
- or entered by use
would you still call it CustomerId or CustomerNumber?
What is your experience regarding for example customer id:s? Do you use both a surrogate key and a natural key? I guess you could you things as tax registration number, organization number or some other entity to uniquely identity a customer.
I have taken customer as an example but i could apply to anything. Supplier, Vendor etc.
This is just general thoughts and it might be rambling a bit but i would appreciate your input.