PostgreSQL

PostgreSQL INNER JOIN

Return only rows with matches in both tables.

Use INNER JOIN

SELECT p.name, c.name AS category
FROM products AS p
INNER JOIN categories AS c
  ON c.id = p.category_id;

An INNER JOIN excludes products without a matching category and categories without a matching product.