Its like i daily learn something new from your videos...
@aZnPriDe707
2 жыл бұрын
Thank you Nate! I love your in-depth walkthroughs.
@ahyoungkim8256
3 жыл бұрын
This video is perfect to understand different ranking functions! Thank you
@stratascratch
3 жыл бұрын
Thank you for watching! Glad you learned something
@marshalllee9599
2 жыл бұрын
Hey Nate here's my solution with cte/case when. Look correct? with cte as ( SELECT customer_id, SUM(CASE WHEN event_type = 'mobile' then 1 ELSE 0 END) as mobile_usage, dense_rank() oVER(order by SUM(CASE WHEN event_type = 'mobile' then 1 ELSE 0 END) dr FROM fact_events GROUP BY 1) SELECT customer_id, mobile_usage FROM cte WHERE dr
@shipragupta4382
3 жыл бұрын
Hi Nate, I really like your all SQL videos. Can you please make few videos on Python as well. Solving same problem?
@stratascratch
3 жыл бұрын
Hi! Yes, I can certainly do some in python for future videos. Thanks for the suggestion!
@techiewithcamera
Жыл бұрын
My Solution: select * from (select customer_id, count(event_id) events, dense_rank() over (order by count(event_id)) rank from fact_events where client_id='mobile' group by 1)x where rank
@joaopedroreissilva7075
3 жыл бұрын
Amazing!
@mathewsjoy8464
3 жыл бұрын
Hey! really enjoyed this video, so when we use subqueries and we do the where and select clause, dont we need to do like subquery.rank to access rank and subquery.events? or is it fine to just leave it as rank and events when trying to access the columns (still quite new to sql) thanks! Also are CTES generally just for readability purposes as they dont have any performance benefits of subqueries, correct me if Iam wrong.
@stratascratch
3 жыл бұрын
I'm not sure what subquery.rank and subquery.events mean? Can you give me an example? If you're talking about aliasing the subquery, then yes, you typically should alias because calling a column. In terms of CTEs, yes they are generally more readable. But also you can reuse CTEs in other parts of your code if you have 1 giant query. So in that case, you are optimizing the performance. Thanks for watching!
@mathewsjoy8464
3 жыл бұрын
@@stratascratch so for example why do we need to give an alias if we are already putting the query inside the () brackets after the from statment of the outer query
@stratascratch
3 жыл бұрын
@@mathewsjoy8464 Oh i see what you mean now. You don't have to put the alias. It's sometimes standard or best practice too depending on your style and/or your companies style guide. I do it from habit.
@girimadhav5816
3 жыл бұрын
Hi Nate thanks for these amazing videos. I couldn't solve problems on stratascratch site. Whenever, I click on Question it redirects to blank page. How can I resolve this issue.
@stratascratch
3 жыл бұрын
That's odd. It's working for myself and my team. Have you tried a different browser or clearing your browser cache?
@girimadhav5816
3 жыл бұрын
@@stratascratch I've tried on incognito too but I couldn't open freemium coding Questions. However, non-coding Questions open up.
@stratascratch
3 жыл бұрын
@@girimadhav5816 You tried clearing your browser cache? You have no javascript blockers? And you are going to platform.stratascratch.com/coding? If you tried all of this can you email me at nate@stratascratch
@fadwa2413
3 жыл бұрын
Hi, are there any different plans for Egypt to subscribe on Stratascratch?
@stratascratch
3 жыл бұрын
We do have parity pricing for people from different country. Try discount code ss15 for 15% off any of the plans!
Пікірлер: 24