I have some issue with figured out how to store postcodes which are splitted into different areas. Example: postcodes between 97000 to 98000 are related to one area, but postcodes between 01000 to 09000 are in second area and so on. I have list all postcodes and areas which they related to but not sure how I should store it in database and later on I will have to add more areas with postcodes which are from different countries and of course notation is different.
So far what I have done I am keeping all postcode like one long string, so it looks like "97000;97001;97002...98000"(I know that is not the best way) for area one. That works fine, cause I can easily searching for one. And that could be enough but it force me to create form where I have to put that whole string and put semicolon between postcodes. Which I would like to change but no idea how(?) And that is my question.
How to bite a topic? How to store areas and postcodes related to it?
Edit: I edit it to explain what exactly I have to do.
I have Warehouse which works only for 6 areas. But those areas have multiple postcodes. So right now I have something like
Warehouses
id | name
Areas
id | warehouse_id | area_number | postcodes (as string)
And I want to change into something like this
Warehouses
id | name
Areas
id | warehouse_id | area_number
Postcodes
id | areas_id | postcode
But that will store multiple references to the same area I am not sure if that is good. (Does not look like good idea)