How can I display sql query from database?
From the error, I assume your code is in a controller? In that case, take note that you should return a render array or an object inheriting the Response class, not HTML.

In your case, just do:

return $items_array;


instead of 

return render($items_array);


But wait!

The table render array should be constructed this way:

$items_array = array(
  '#theme' =&gt; 'table',
  '#header' =&gt; $header, 
  '#rows' =&gt; $rows,
); 


For a reference of what you can pass in, check out https://api.drupal.org/api/drupal/core%21modules%21system%21templates%21table.html.twig/8.1.x

Other notes

The way you are querying data is not wrong per se but definitely not the "Drupal way". To perform queries using Drupal's DBAL, check out https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!database.api.php/group/database/8.2.x