Practice Interview Questions
| Question | Status |
|---|---|
You have access to a social media database, containing tables related to user posts, friendships, and likes. Your goal is to calculate the total number of likes made on posts by friends specifically on Fridays.
user_posts table:
| Column Name | Description |
|---|---|
| post_id | Identifier of post |
| user_name | Username |
| date_posted | Date posted |
friendships table:
| Column Name | Description |
|---|---|
| user_name1 |
| Friend 1 |
| user_name2 | Friend 2 |
likes table:
| Column Name | Description |
|---|---|
| user_name | Username |
| post_id | Identifier of post |
| date_liked | Date liked |
Example output:
| date_liked | likes |
|---|---|
| 2024-01-05 | 3 |
| 2024-01-12 | 1 |
You have access to a social media database, containing tables related to user posts, friendships, and likes. Your goal is to calculate the total number of likes made on posts by friends specifically on Fridays.
user_posts table:
| Column Name | Description |
|---|---|
| post_id | Identifier of post |
| user_name | Username |
| date_posted | Date posted |
friendships table:
| Column Name | Description |
|---|---|
| user_name1 | Friend 1 |
| user_name2 | Friend 2 |
likes table:
| Column Name | Description |
|---|---|
| user_name | Username |
| post_id | Identifier of post |
| date_liked | Date liked |
Example output:
| date_liked | likes |
|---|---|
| 2024-01-05 | 3 |
| 2024-01-12 | 1 |