I am trying to design a database to automatically generate new unique SKU numbers based on the following parameters.
I want to be able to select the gender from a table, automatically insert the current year, select a user ID from a table, auto generate the style number and and colour.
The problem I have is that the generated SKU must be unique, no duplicates, but the style number can have variations, example B230001A (example Blue), B230001B (example red), PB230001A (blue), PB230001C (example yellow)
Example SKU: B230001A
B = the gender
- B= Boys
- G= Girls
- TG= teen girls
- TB= Teen boys
- PB= pre boys
- PG = pre girls
- M= Mens
- L = ladies
- TD = Toddlers
USER ID
- 0 = GREG
- 1= Keri
- 2 = Shalin etc
Colour
- 1st colour is A, Second B, third colour C etc
Attachment 50088
I have created separate tables for Gender, Users, Year, Style No. and colour, but How do I bring these all together to generate the final SKU number?