Practice Interview Questions
| Question | Status |
|---|---|
Establish the email activity rank for each user, considering the total number of emails sent. The user sending the most emails secures rank 1 and so on. Output includes user, total emails, and their activity rank. Records are organized by total emails in descending order, and for users with the same email count, alphabetical sorting is applied.
google_gmail_emails table:
| Column Name | Description |
|---|---|
| id | Identifier of email |
| from_user | Sender user |
| to_user | Recipient user |
Example output:
| from_user | total_emails |
|---|
| rank |
|---|
| 32ded68d89443e808 | 19 | 1 |
| ef5fe98c6b9f313075 | 19 | 2 |
| 5b8754928306a18b68 | 18 | 3 |
Establish the email activity rank for each user, considering the total number of emails sent. The user sending the most emails secures rank 1 and so on. Output includes user, total emails, and their activity rank. Records are organized by total emails in descending order, and for users with the same email count, alphabetical sorting is applied.
google_gmail_emails table:
| Column Name | Description |
|---|---|
| id | Identifier of email |
| from_user | Sender user |
| to_user | Recipient user |
Example output:
| from_user | total_emails | rank |
|---|---|---|
| 32ded68d89443e808 | 19 | 1 |
| ef5fe98c6b9f313075 | 19 | 2 |
| 5b8754928306a18b68 | 18 | 3 |