Hey there! 👋 For more interesting content, tutorials, and updates, Feel free to connect with me on Instagram Handles :- @createwithchirag - instagram.com/createwithchirag/ @learn.with.chirag - instagram.com/learn.with.chirag/ LinkedIn: www.linkedin.com/in/chirag-sehgal-9200111b8/ Let's stay connected and keep the creativity flowing! 💡
In the first part of the query, you can use COUNT(rating) instead of COUNT(movie_id) & COUNT(user_id) because the rating attribute in the MovieRating table represents the number of ratings given by users for movies. So, all the three COUNT(rating) ,COUNT(movie_id) and COUNT(user_id) would give you the count of ratings given by each user, and ordering by either of them would achieve the same result in this specific context. But yes you are correct , COUNT(user_id) is the best choice among the three options for this specific scenario, as it provides clarity, aligns with the semantics of the task, and accurately represents the count of ratings given by each user.
Just keep practicing a few queries daily....I believe after solving 50-60 questions you will get enough confidence to think and solve in the exam/interview...💯 Also Time to time revision is must !!
Hey there! 👋 For more interesting content, tutorials, and updates, Feel free to connect with me on
Instagram Handles :-
@createwithchirag - instagram.com/createwithchirag/
@learn.with.chirag - instagram.com/learn.with.chirag/
LinkedIn: www.linkedin.com/in/chirag-sehgal-9200111b8/
Let's stay connected and keep the creativity flowing! 💡
Thanks for easy and simple explanation :)
Bhai count(user_id) karna tha first part mein yaa count(rating)kyunki rating toh movies ki hai aur count of users toh user_id se hogi na?
In the first part of the query, you can use COUNT(rating) instead of COUNT(movie_id) & COUNT(user_id) because the rating attribute in the MovieRating table represents the number of ratings given by users for movies. So, all the three COUNT(rating) ,COUNT(movie_id) and COUNT(user_id) would give you the count of ratings given by each user, and ordering by either of them would achieve the same result in this specific context.
But yes you are correct , COUNT(user_id) is the best choice among the three options for this specific scenario, as it provides clarity, aligns with the semantics of the task, and accurately represents the count of ratings given by each user.
How lexicographically smaller is working in this query ?
best explanation
Glad it was helpful to you 💐💯
It's evident that currently you are so good at sql but how do you develop this skill?
Just keep practicing a few queries daily....I believe after solving 50-60 questions you will get enough confidence to think and solve in the exam/interview...💯
Also Time to time revision is must !!
Thanks
Glad it was helpful !