Every time I worked on a project that required a list of Indian Cities and States in my database, I looked for an SQL Dump online only to be disappointed every time. Don’t get me wrong, it’s not like I couldn’t find any – there are tons of them, rather everytime my database structure and requirements slightly differed. Sometimes it would just be a matter of having a different table name or column name, you can easily edit an sql file to change the names before importing.
But what if you want to change the order of the columns or even worse – add or delete a column, it would be a nightmare on a 1500 row dump, wouldn’t it? So I decided to create a tool for myself that would customize and generate an sql file exactly as I want it to be.
I used this tool on a few of my past projects and was happy with the results, I could customize and generate a handy sql file in seconds.
Today, I wanna share this tool with all of you so you could use this on your next project. It’s easy as clicking a button. No seriously, if you don’t want any customization, just click the generate button, it’ll create a standard file for you. Go ahead and give it a try
SQL Generator for Indian States
SQL Generator for Indian Cities, Towns and Villages
You can bookmark the above links and visit them whenever you’re in need of an sql dump of Indian cities and states.
Help Us Improve
The project is not done yet. I’m open to any feedback you have to improve the tool further. Also, I believe the list of cities, towns and villages is not complete yet. For instance, I couldn’t find a list cities in Telangana state. So I’ve uploaded the csv files that the generator uses to generate sql files. You can download these files, add missing places and send them to me.
Download cities.csv
Download states.csv
Once I review the changes, I’ll upload the csv file which will be subsequently used for future generations. As a reward, I’ll feature your name and one of your link in the generated file to give you your well deserved credit. So include that in the mail as well.
Update: March 2, 2017
I’m happy to announce that we’ve managed to compile a list of all pincodes available in India. The data is based on what was available over at data.gov.in ‘s database which was hand cleaned and sorted. This gave us an even better list of Cities and States as well which are still available at old links. List of pincodes can be generated at the link below:
SQL Generator for Pincodes in India
Want to contribute? CSV file for Pincodes are available here.
Once again, if you have any feedback or find a bug, let me know in the comments below.
6 thoughts to “SQL Generator – List of India’s Pincodes, Cities and States in SQL format”
Hi
Thanks for your effort for making this too.
I think Puducheri(Pondicheri) is missing from the states list.
please update all new cities like new delhi , navi mumbai etc
I am looking for data two different tables: tbl_state and tbl_city.
If you need latest cities of india and state in sql, please mail me
Didn’t get your point
How to compare it with old cities and import only new data