1264. Page Recommendations

https://leetcode.com/problems/page-recommendations

Description

Table: Friendship

+---------------+---------+
| Column Name   | Type    |
+---------------+---------+
| user1\_id      | int     |
| user2\_id      | int     |
+---------------+---------+
(user1\_id, user2\_id) is the primary key for this table.
Each row of this table indicates that there is a friendship relation between user1\_id and user2\_id.

Table: Likes

+-------------+---------+
| Column Name | Type    |
+-------------+---------+
| user\_id     | int     |
| page\_id     | int     |
+-------------+---------+
(user\_id, page\_id) is the primary key for this table.
Each row of this table indicates that user\_id likes page\_id.

Write an SQL query to recommend pages to the user with user_id = 1 using the pages that your friends liked. It should not recommend pages you already liked.

Return result table in any order without duplicates.

The query result format is in the following example:

ac

Last updated

Was this helpful?