Error Upgrading DB to 4.7.18: SQL
The upgrade for 4.7.18 tries to insert new state in civicrm_state_province table. This was done via https://issues.civicrm.org/jira/browse/CRM-19993.

But seems you already have Chandigarh in the table due to which mysql finds a duplicate row already present in the database and eventually displays an error. So the question is how this record is already present in your database?


Have you tried this upgrade for 4.7.18 before and retrying this again? If yes, try getting a backup of the previous version and then start the upgrade process.
Have you added the new state Chandigarh in your DB manually in your previous version? 
In this case, you can simply delete the Chandigarh entry manually from civicrm_state_province table and restart the upgrade. It will create the entry for Chandigarh so you'll not lose any state record from your DB.