0

I've got the following three tables (in MySQL):

user
+---------+-----------+
| user_id | user_name |
+---------+-----------+
|    0    | Jessica   | 
+---------+-----------+
|    1    | Chris     |
+---------+-----------+
|    2    | Jane      |
+---------+-----------+


link
+-----------+--------------+
| link_id   | link         |
+-----------+--------------+
| 0         | x.com        |
+-----------+--------------+
| 1         | y.com        |
+-----------+--------------+


link_seen
+----+-----------+----------+
| id | link_id   | user_id  |
+----+-----------+----------+
| 0  | 0         |  0       |
+----+-----------+----------+
| 1  | 0         |  1       |
+----+-----------+----------+
| 2  | 1         |  0       |
+----+-----------+----------+

Users who click on the link in the link table are added to the "Link_seen" table. I want to list the users who didn't click on the link. But I couldn't find the right query. I want to return the result as below. (If it's not possible, I can also accept the query listing users who didn't click on a certain "link_id" value)

Link name & Users who did not click the link 
+-----------+----------+
| link      |user_name |
+-----------+----------+
| x.com     |   Jane   |
+-----------+----------+
| y.com     |   Chris  |
+-----------+----------+
| y.com     |   Jane   |
+-----------+----------+
quahvaen
  • 21
  • 1
  • 3

0 Answers0