Postgresql – How to relate two tables of data

database-designpostgresql

enter image description here

Hello, I have this simple diagram showing two tables, event table and guest table.

I created an event which has id of 1 and there are 3 guests for event id of 1. If I want to reuse the same guests for event id 2 and 3, how do I relate them using a foreign key? What if I want to remove Joe from the event 2, how do I do it so that it won't delete Joe from the table because Joe is needed for event 1? I am confused and I don't know if my question is clear enough. Do I need to add some columns to help this out?

Best Answer

uses a third table that will link the Event table to the Guest table :

enter image description here