2

I'm currently developing an online android application for information spreading for groups, which consists of several table,, Now I've created all the tables except one last table, notification table..

I want to create this notification table which is referring to multiple table, every time new activity has been committed, it will automatically stored the data on the notification table, and I want to combine all the primary key needed to create a notification from another table to one column (To avoid null column)

For example, I want to create an announcement in one group, the announcementId will be inserted to SourceId, and the groupId will be inserted in ReceiverId in NotificationTable, another example is if a user is being invited to join a group, it will store the groupId as SourceId and Invited Member as ReceiverId.

But I figured out recently that one column (as foreign key) can't referring to multiple column in multiple tables (SourceId, and ReceiverId can't refer to many tables)..

I read this article Phone database design, and I don't know how to make it, I can't make my SourceId and ReceiverId referring from multiple tables, is it any better way for me to solve this problem?

Ps : Sadly I don't have enough reputation to post my ERD picture, here is my ERD

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
redRabbit
  • 79
  • 10
  • Does this answer your question? [How can you represent inheritance in a database?](https://stackoverflow.com/questions/3579079/how-can-you-represent-inheritance-in-a-database) – philipxy Mar 05 '20 at 06:06

0 Answers0