title: Get product name and price from product collection
body: <p>I am trying to get product(s) name and price from product collection for that I have created a custom script for test.</p>
  <pre><code>$bootstrap = Bootstrap::create(BP, $_SERVER);
  $objectManager = $bootstrap-&gt;getObjectManager();
  $state = $objectManager-&gt;get('\Magento\Framework\App\State');
  $state-&gt;setAreaCode('adminhtml');
  $collection = $objectManager-&gt;create('\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory')-&gt;create();
  try {
      
      echo $collection-&gt;addAttributeToSelect(['name','sku'])-&gt;getSelect();
  } catch (Exception $exception) {
      echo $exception-&gt;getMessage().&quot;\n&quot;;
  }
  </code></pre>
  <p>but when I run this script to check MySQL query I am getting below output:</p>
  <pre><code>SELECT `e`.* FROM `catalog_product_entity` AS `e`;
  </code></pre>
  <p>How can I get only product name and price instead of whole data?</p>