Question
Capgemini
Capgemini
IN
Capgemini
Posted: Mar 20, 2025
Last activity: Mar 20, 2025
Last activity: 20 Mar 2025 9:33 EDT
Table strcture for cascading select for country state and city
I have a cascading dynamic select where in country,state and city list are cascaded.
Should I create 3 different tables for country,state and city or just one table with all three will be fine.
Please suggest what is the best way to design this and why
***Edited by Moderator Marije to add Capability tags***
To see attachments, please log in.
Hi @RituK17288411,
You can achieve this requirement with a single table and 3 Data page.
D_CountryList : to fetch all unique country from you table.
D_StateListbyCountry : to fetch all unique states for a selected country(First cascading)
D_CityListbyState : to fetch all cities from a selected country and state(Second cascading)
In real life of scenario its very rare to store cities of each country(as it will result in huge data).
If you are implementing this solution for lot of countries then you can think about normalizing data in different tables.
Hope this helps.
Thanks, Ankit