SELECT
c.record_number
,c.Name
,SUM(pw.Stock) AS `Total_Stock`
FROM Categories c
LEFT JOIN REL_Products__Categories pc 
     ON c.record_number = pc.Categories_rn
LEFT JOIN REL_Products__Warehouses pw
     ON pc.Products_rn = pw.Products_rn
