Magento 2: Create/Alter Database Table & Insert Data while Installing/Upgrading Module

This article shows how you can create a new database table and install data into the table while installing a custom module or upgrading the module in Magento 2. The install and upgrade setup script file should be inside the Setup folder of your module. The install script should be named InstallSchema.php & InstallData.php and … Read more

Magento: Join, filter, select and sort attributes, fields and tables

In my previous article (Magento: Very Useful Collection Functions), I had written about database interaction functions present in class Varien_Data_Collection_Db. Here, I am going to explain some database interaction functions present in the class Mage_Eav_Model_Entity_Collection_Abstract. These collection functions are very useful to select data from Magento database. We need them almost all the time for … Read more