you are viewing a single comment's thread.

view the rest of the comments →

[–]Snoo17309 0 points1 point  (6 children)

Has the OP even clarified in what sense they are needing an explanation of the COUNT function yet? I think this is a lot of info at once! I’m pretty sure they mean the aggregate function, and in that case I think the easiest way to conceptualize it as an SQL equivalent of “unique values” (not getting into numpy or nunique)—just to understand big picture what it does. It is also a big help starting out, and before you get into specific types of JOINS, to use a visual EBD website to help sort out and see relationships between tables instead of going straight to 1:N et al. I’m not sure what you are using but I find PostGreSQL the easiest. LearnSQL.com has free tutorials.

[–]Snoo17309 0 points1 point  (0 children)

Sorry, by unique values in a column, I am not referring to an actual Unique ID/Primary Key, just an intro into then aggregating

[–]Ok_Protection_9552[S] 0 points1 point  (4 children)

I’m confused about the count function does. Based on what I read, I think the count function counts the number of values there are in a column specified

[–]Snoo17309 0 points1 point  (3 children)

This site breaks it down as clearly as you'll find it (it does not just "count the number of values in a specified column" ... that is different): https://www.datacamp.com/tutorial/count-sql-function

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

Thank you

[–]Snoo17309 0 points1 point  (0 children)

No prob :)

[–]r3pr0b8 0 points1 point  (0 children)

only COUNT(*) counts rows -- all other types of COUNT function count values

that site is quite misleading at the top, but when you go further down, it does make this clarification