What are Setup Scripts in Magento 2 and why you should use them

So you have created your first Magento 2 module.

You have created the registration.php, the module.xml, everything. You have taken good care to see that your code quality is good and you have put comments for every single class and function you’ve developed. Sounds like a perfect module right? One small catch.

Your module requires a table to be created in the database, let's say “my_first_module_table”. And it has four columns.