News for hackers. Stuff that matters.
Re:Advanced SQL window function quiz by andy_boot on Friday February 09, 2018 @01:27AM (#16338338)
Author here - I'm scrolling thru the logs and it is interesting to see that on the first question lots of people try to write "select name, total_weight" despite there only being a weight column which you have to use an aggregate on to get the total weight.

I guess I need to rethink my design a little.

Re:Advanced SQL window function quiz by koyote on Friday February 09, 2018 @04:52AM (#16339079)
I did that and to be honest I am not quite sure why.

I think it's due to lack of reading the question properly and impatience.

But it also might be due to how programmers sometimes think/work. Often, when I am trying to solve a problem I like writing something (anything) down in broad strokes first so that I can then go back in and 'fix' each smaller part of the larger problem.

Re:Advanced SQL window function quiz by meritt on Friday February 09, 2018 @02:38AM (#16338574)
The vast majority of developers don't know SQL beyond simple CRUD queries. The surge in popularity of NoSQL over the past decade has made SQL become a lost art. Even when using relational databases, ORMs often alleviate the need for understanding the principles.

Thank you for making this.

Q6 has a flaw. You request "Order by: ranking, name" but the accepted solution sorts by rank only (Alfie should come before Ashes)

Re:Advanced SQL window function quiz by danielbarla on Friday February 09, 2018 @02:05AM (#16338471)
I suspect there's a need to keep the design simple, but the source table schema should probably be more prominent. I suspect most people try to guess the names of the columns before they ever click "Show table schema".

Nice quiz, by the way, and I like the topic. In my experience, too few devs / dbas make good use of window functions.

Re:Advanced SQL window function quiz by Karlozkiller on Friday February 09, 2018 @03:10AM (#16338683)
I thought the underlying schema was pretty obvious. However I made lots of mistakes due to trying it out from my phone, and it didn't cooperate as well as one would've liked.

But I think the design was good. I also noticed the option to look at the schema, if needed.

Re:Advanced SQL window function quiz by johannes_ne on Friday February 09, 2018 @01:58AM (#16338446)
It took me a while to see the 'show schema' link. Maybe this should always be shown.
Re:Advanced SQL window function quiz by jabagawee on Friday February 09, 2018 @02:05AM (#16338472)
Quick bit of feedback: question 10 refers to the "WINDOW command" which I think should be called the "WINDOW clause" to help clueless folks (ie me) Google for it.
Re:Advanced SQL window function quiz by andy_boot on Friday February 09, 2018 @02:22AM (#16338528)
good idea. I'll fix that.
Re:Advanced SQL window function quiz by oneweekwonder on Friday February 09, 2018 @06:48AM (#16339495)
You had me on the plural for your table names. Have not seen it in a while. Personally believe it is a preference thing.
Re:Advanced SQL window function quiz by andy_boot on Friday February 09, 2018 @09:40AM (#16340443)
Despite being the author I think you are correct. It should be table: 'cat' not 'cats'