How to generate serial numbers and store the same in database?

  1. must the first part be sequential (001, 002), or random (003, 768, 392, 123)?

  2. is PP always fixed?

  3. how may positions for first part (in your example 3: 001, 002)?