In which table is a path alias stored?
They're in the aptly named url_alias table, but you shouldn't query it directly. The path alias manager service is preferable:

$alias = \Drupal::service('path.alias_manager')
    -&gt;getAliasByPath("/node/$nid");


As always, inject the service if you can.