SQL JOINS | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

24th Jul 2022, 3:56 AM
Knowledge Is Power
Knowledge Is Power - avatar
3 Answers
+ 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.
26th Jul 2022, 5:57 AM
Brian
Brian - avatar
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.
24th Jul 2022, 9:11 AM
Brian
Brian - avatar
0
Brian Thank you so much for your support
26th Jul 2022, 2:39 PM
Knowledge Is Power
Knowledge Is Power - avatar