Home » Archive

Articles tagged with: Database

Database, MySQL »

[4 Apr 2016 | No Comment]

This article shows SQL query to get size (in MB) of all MySQL databases. It also shows the query to get the size (in MB) of all the tables present in any particular database.
Get size (in MB) of all MySQL databases

Database, MySQL »

[7 Feb 2012 | No Comment]

This article shows:-

– How to add column to mysql database table after the table has already been created
– How to delete column from mysql database table after the table has already been created

Database, MySQL »

[18 Jul 2011 | 3 Comments]

Some definitions of foreign key:-
A FOREIGN KEY in one table points to a PRIMARY KEY in another table.
A foreign key is a field in a relational table that matches the primary key of another table. The foreign key can be used to cross-reference tables. A table may have multiple foreign keys, and each foreign key can have a different referenced table.

Magento »

[15 Nov 2010 | 12 Comments]

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 filtering collection object.

Magento »

[12 Jul 2010 | 35 Comments]

I got this error message when migrating my Magento files and database from one server to another.
Notice: Undefined index: 0 in app/code/core/Mage/Core/Model/Mysql4/Config.php on line 92
Solution:

Database, MySQL, SQL »

[15 May 2010 | 2 Comments]

The JOIN keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables. [@via w3schools]
A SQL JOIN clause combines records from two or more tables in a database. It creates a set that can be saved as a table or used as is. A JOIN is a means for combining fields from two tables by using values common to each. ANSI standard SQL specifies four types of JOINs: INNER, OUTER, LEFT, and RIGHT. In special cases, …

Magento »

[7 Dec 2009 | 6 Comments]

Suppose, you have a module called MyModule. Its version is 0.1.0. Now, you want to do some database changes for the module. You have the mysql setup file (mysql install file) mysql4-install-0.1.0.php in MyModule/sql/mymodule_setup folder of your module.
You don’t need to make direct changes to database. You can upgrade your module to make your necessary database changes. To do so,

Magento »

[27 Nov 2009 | 12 Comments]

Difference between EAV and Flat Catalog
In EAV database model, data are stored in different smaller tables rather than storing in a single table.
Like,
product name is stored in catalog_product_entity_varchar table

PEAR, Smarty »

[18 Jul 2008 | One Comment]

For using database, you need to install a package of PEAR called ‘MDB2’ along with the installation of PEAR and Smarty.
MDB2 provides a common API for all support RDBMS.

Database, MySQL »

[10 Oct 2007 | No Comment]

This article shows how to backup and restore single & multiple databases and tables in MySQL.
1) Backup single database
mysqldump -h hostname –u username –p password database_name > /path/backup.sql