I have created one custom drop down attribute with value 'yes' or 'on'. Now my question is how can we write a MySQL query to retrieve newly added products in category wise which are checked 'yes' by using custom attribute for MySQL database and where we have to place that query? Here I want to display these newly added products on home page category wise.
You want to do it inside Magento? Use collections instead.
$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addAttributeToSelect('*'); // Or only the attributes that you need
$collection->addAttributeToFilter('your_attribute', array('eq' => '1'));
foreach ($collection as $product) {
echo $product->getId();
}