How would i write this in an SQL Query. List all product names (ProductName) from the DimProduct table no matter if a product has been purchased by customers or not as well as the total sales (sum of the SalesAmount in the FactOnlineSales table) from the product. ProductKey is the joining column for the two tables. If a product has been purchased by customers, The ProductTotalSales column shows the total sales from the product. If a product has not been purchased by any customer, The ProductTotalSales column just shows NULL. Order the result by ProductTotalSales in descending order (desc)

Q&A Education