How to select fields from content type What is the best way to do a db query for fields in a content type?

I need to get specific fields from a content type, but only where the 'featured' field value is 1. 

&lt;?php
        $query = new EntityFieldQuery();

        $query-&gt;entityCondition('entity_type', 'node')
          -&gt;entityCondition('bundle', 'mycontenttype')
          -&gt;propertyCondition('status', NODE_PUBLISHED)
          -&gt;fieldCondition('field_mypdf', 'value', 'NULL', '!=')
          -&gt;fieldCondition('field_mypdf', 'fid', 'NULL', '!=')
          -&gt;fieldCondition('field_mypdf_image', 'fid', 'NULL', '!=')
    ?&gt;


Originally, I was doing something along the lines of:

&lt;?php 
$query = "SELECT node.nid AS nid, 'node' AS field_data_field_news_node_entity_type, 'node' AS field_data_field_news_date_text_node_entity_type, 'node' AS field_data_field_news_teaser_node_entity_type, 'node' AS field_data_field_news_body_node_entity_type, 'node' AS field_data_field_news_video_node_entity_type, 'node' AS field_data_field_news_video_image_node_entity_type, 'node' AS field_data_field_mypdf_node_entity_type
    FROM node
    INNER JOIN field_data_field_news_is_featured ON node.nid = field_data_field_news_is_featured.entity_id AND (field_data_field_news_is_featured.entity_type = 'node' AND field_data_field_news_is_featured.deleted = '0')";
?&gt;

$result = db_query($query);

&lt;?php foreach ($result as $row) : ?&gt;

    &lt;div class="featuredArticle"&gt;
        &lt;?php print $row-&gt;field_mypdf_value; ?&gt;
        &lt;?php print $row-&gt;field_mypdf_fid; ?&gt;
    &lt;/div&gt;

&lt;?php endforeach; ?&gt;
I think choice is in between EntityQuery and db_select and EntityQuery seems to be a better choice for Entities as it takes care of joining different fields for you.

Reference Link: EntityFieldQuery vs Db_select() -

@Bart says: - 


  I think that the main reason prefering EntityFieldQuery over db_select
  is that you don't have to know about the lower-level structure, in
  other words: how stuff is stored in the database. This improves loose
  coupling.


@Berdir comment:- 


  This is correct, although it goes even further. The field storage is
  pluggable. The default implementation stores field data in a separate
  table per field in the database, but it can be replaced, there is for
  example an implementation which allows to store field data in MongoDB.
  If you want your code to be portable and not just work on your
  specific site configuration, you must use EntityFieldQuery.