Using forward slash


#1


https://www.codecademy.com/courses/sql-table-transformation/lessons/conditional-aggregates/exercises/combining-aggregates-ii?action=lesson_resume&link_content_target=interstitial_lesson


Hello, I just want to know what the forward slash [ / COUNT(*) ] in the answer for this exercise is used for? It's the first time I've seen it anywhere. If I had to guess it's for division, but I've been wrong a lot with SQL. Thank you!


SELECT state, 
		100.0 * SUM(CASE WHEN elevation >= 2000 
            THEN 1 ELSE 0 END) / COUNT(*)  
            as percentage_high_elevation_airports 
            
FROM      airports 
GROUP BY  state;


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.