Fetching node field values programmatically
I think you should leave the database structure and focus on the entities concept.

This brings you to a simpler approach using entityTypeManager  to get nodes and filter them by whatever you want.

$query = $this-&gt;entityTypeManager()-&gt;getStorage('node')-&gt;getQuery();
$nids = $query-&gt;loadByProperties(
    [
        'type' =&gt; 'content_type',
        'status' =&gt; 1,
        'field_name' =&gt; 'value'
    ])
    -&gt;execute();