0
SQL JOINS
I am having hard time solving the joins problems please help https://code.sololearn.com/ck2T7a1ZFjy3/?ref=app https://code.sololearn.com/cVcW7Izt62lS/?ref=app
3 odpowiedzi
+ 1
I found a moment to look at the code and stopped at the first query. It looks like there was a copy/paste error after the SELECT.
#Return the sum of the units sold by product name.
SELECT DimProduct.product_id= FactSales.product_id
SUM(FactSales.units_sold) AS unit_sold_total
The SELECT keyword should be followed by a list of columns to output. The task asks for product name and sum of units sold:
SELECT DimProduct.product_name,
SUM(FactSales.units_sold) AS unit_sold_total
The rest of that query looks good.
I'll look at the others when I have time.
0
Hi Knowledge Is Power, could the problem be in the misspelling of field name, quarter, in the create table for DimDate? I noticed that the select statement field name does not match the misspelled name in the table definition.
Edit: Oops, now I know that QUARTER in the DATEPART function is not a field name. I'll have to look further for the issue.
0
Brian Thank you so much for your support