I would like to know the proper usage of ditta and azienda and how do we differentiate between them in Italian.
In every day speaking they can be used as synonyms, the difference stands in the legal meaning which distinguishes them clearly:
impresa is the activity performed by the entrepreneur and it can be carried out among various fields;
azienda is the whole set of assets organized by the entrepreneur in order to carry out activities (art. 2555 Italian Civil Code) and it includes premises, furnitures, machinery, facilities, etc.;
ditta, finally, is the trade name of the entrepreneur (art. 2563 Italian Civil Code), namely the name used to pursue their activity in order to draw a distinction between their company and competitors thereof.
You can more information here although in Italian.
The definitions that have been given are right, but sometimes "ditta" is used with a broader meaning. In everyday speaking sometimes azienda and ditta are used as synonyms. I've often heard people saying "Vado in ditta" or "In ditta abbiamo questo macchinario" meaning the building. Probably it's not perfectly correct, but it's used. http://www.garzantilinguistica.it/ricerca/?q=ditta For example: http://www.torinotoday.it/cronaca/cassoni-rubati-fiat-leini.html http://m.ilgiornaledivicenza.it/territori/montecchio/sovizzo/infortunio-in-ditta-30enne-schiacciato-da-un-muletto-1.5786745 http://www.ilgiorno.it/lodi/cronaca/incidente-1.3218940