query to fetch all path aliases's content type and title
Can you try:

$connection = \Drupal::database();
$query = $connection-&gt;select('node_field_data', 'n');
$query-&gt;leftJoin('url_alias', 'u', 'n.nid = u.source');
$result = $query-&gt;fields('n', ['changed', 'nid', 'type']);
$result-&gt;addField('u', ['alias']);

$result-&gt;execute();


foreach ($result as $rows) {
  $totalRows[] = $rows;
}


I saw two main problems.

1) Basically you had a mistake that was causing runtime error: 

$query-&gt;join('url_alias', 'u', '/node/n.nid = u.source');


2) Using join, where for this you need left join.

Different types of joins:
https://stackoverflow.com/questions/5706437/whats-the-difference-between-inner-join-left-join-right-join-and-full-join

Tip: Before running $result->execute(), you can run $string = $result->__toString(). 
This will give you the produced raw SQL. You can use it in a tool like adminer/phpmyadmin to debug in more detail.

Best regards,
Oleg