SQLQuokka
Start practicing
QuestionsLearnSandboxFeaturesRoadmapFAQ

Most Connected Members

Unsolved

A social network stores every accepted friend request once in request_accepted. Both people become friends with each other, so a person's friend count includes requests they sent and requests they accepted. If several people tie for the most friends, return all of them. Write an SQL query that returns id and num (the number of friends) for the most-connected person or people. Order the results by id ascending.

SQL Query Editor (Ctrl+Enter to run)
0 characters · Valid
Canonical Solution Official

Official Solution is Hidden

Try solving the question with the schema explorer and hints first. When ready, reveal the verified canonical query and step-by-step logic breakdown.

Community Q&A & Discussion

Ask questions, share alternate queries, and explore solutions

0 comments
Asked By:
Classic pattern · not tied to a specific company

Submission History

Your recent query executions and answer checks

Execution Pipeline:
FROM request_accepted
Full source dataset
6 rows total
Ready. Type a query to see live execution.
Clause: Auto-Sync · AlaSQL Engine