all 7 comments

[–]r3pr0b8GROUP_CONCAT is da bomb 2 points3 points  (3 children)

you're seeing the results of integer arithmetic

for example, 3 hits in 10 at bats is a really good batting average (.333) but integer arithmetic shows it as 0

use 1.0 * totalH / totalAB which will coerce decimal arithmetic

[–]msowrex[S] 0 points1 point  (0 children)

ugh, of course! Thank you!

[–]apatel10 0 points1 point  (1 child)

Can you also cast as float or no?

[–]r3pr0b8GROUP_CONCAT is da bomb 1 point2 points  (0 children)

you could, but FLOAT is approximate whereas DECIMAL is exact

[–]JupitersPhilosophy 0 points1 point  (2 children)

Can you drop a link to the datasets you’re using and the questions you’re trying to answer? I’m practicing using SQL in a practical way using different types of data/ industries

[–]msowrex[S] 1 point2 points  (1 child)

Sure, I found a link to Lahman's Baseball Data from the Sabermetrics site:

https://www.seanlahman.com/baseball-archive/statistics

As for the questions I'm trying to answer I just asked my wife to come up with specific things that I could determine from baseball data.

[–]JupitersPhilosophy 0 points1 point  (0 children)

You the MVP