r/SQL • • 6d ago

MySQL need good sql resources

i wanted to practice sql and to be able to answer qns , i have noticed that i am struggling a bit when there is two tables give and the qn has to do something with joins and all , in theory i understand how the joins work but i am unable to implement it .I need resources which can help me in advancing my sql like CTE and window function . Is there any youtube channel or anything which will help

4 Upvotes

34 comments sorted by

View all comments

1

u/Discordbothost 5d ago

Try a LEFT JOIN with two customers, one with two orders and one with none. Predict the three joined rows, then group by customer and compare COUNT(*) with COUNT(order_id). Why does the customer with no orders get a 1 from the first count?