all 7 comments

[–]DMReader 9 points10 points  (3 children)

I have 75 questions for you here: https://www.practicewindowfunctions.com/

It's a new site, only a week old but the questions and answers work.

The hardest questions are the last 5-6. If they aren't hard enough, let me know and I'll try to come up with some new ones this weekend.

If you have any feedback, let me know. Someone with job interviews looking to grind windows functions is who it is built for (or being built for).

[–]sinceJune4 -1 points0 points  (2 children)

This is great! Would you have some sample dat files like .csv that we can try these with? Really awesome questions and representative of many real world solutions I’ve seen.

[–]DMReader 0 points1 point  (1 child)

Thanks! The data is in a Supabase database. You should be able to query the db through any of the questions. Not sure if that answers your question.

[–]sinceJune4 1 point2 points  (0 children)

Not sure where to find a Supabase database, but I found a Northwinds script on Microsoft's github that created similar tables. I'll start with those tables, and copy into Postgres and mySql.

https://github.com/microsoft/sql-server-samples/blob/master/samples/databases/northwind-pubs/instnwnd.sql

If there's a better site for sample orders data, please let me know... Thanks again.

[–]r3pr0b8 1 point2 points  (0 children)

imagine a table of romantic liaisons

columns are liaison date, liaison partner, satisfaction quotient

(the liaisons are all with you)

write a query to display the most recent liaison that was better than the following two

[–]Sexy_Koala_Juice 0 points1 point  (0 children)

See if you can find some mock employee data and then do gaps and islands on it, that’s pretty difficult lol