Consider a simplified table schema of a StackOverflow-like system:
Tables:
User ( id, name )
Question ( id, user_id, question )
Vote ( id, question_id )
How would I write a SQL query that would
- List each user along with the total votes for all his questions, ordered by most votes?
- Given a user_id, return a single user record, along with his total votes?
User Name | Total Votes (desc)
1 Answer