oreilly_getting_started_with_sql icon indicating copy to clipboard operation
oreilly_getting_started_with_sql copied to clipboard

Code not working.

Open anmoljain1230000 opened this issue 4 years ago • 1 comments

Kk @

![20210119_134543](https://user-images.githubusercontent.com/77664305/105007144-a1ec2c00-5a5d-11eb-8766-4337c288c3df.jpg)

anmoljain1230000 avatar Jan 19 '21 08:01 anmoljain1230000

The SQL query you found appears to have some syntax errors. I'll correct it and check if it's wrong

Here's the corrected SQL query:

SELECT year, SUM(precipitation) as total_snow, MAX(precipitation) as max_precipitation FROM STATION_DATA WHERE year >= 2000 GROUP BY year; Changed SUM(precipitation) as max precipitation to MAX(precipitation) as max_precipitation to find the maximum precipitation value.

Corrected WHERE YER >=2000 to WHERE year >= 2000 to compare the year correctly.

This query should now work correctly to calculate the total snow precipitation (total_snow) and the maximum precipitation (max_precipitation) per year starting from 2000 in the STATION_DATA table.

SilvioCruzDeveloper avatar Mar 15 '24 01:03 SilvioCruzDeveloper