How to tell progressbar to progress how many percent for what?

How to tell progressbar to progress how many percent for what?

How to tell progressbar to progress how many percent for what?
For example I want to use it for a database installer. If I have 50 tables, so after each table creation I want to make progress the bar 2% so after 50 tables it will be 100% or complete. In example or demo I did not see how to do this?