I have 2 tables, Resources and ChapterMap.
The Resources table contains records of educational resources. This table has a set of columns relating to Topics (RES_Topic_Sports, RES_Topic_Politics, RES_Topic_CurrentEvents, etc.). If the value of one of these fields is 1, the resource relates to that topic.
The ChapterMap table links topics to chapters in a book. Each record in this table has a Topic field with values like (Sports, Politics, Current Events, etc.). It also has links to the book chapter and sections (FR_Ch1_Sec1, FR_Ch1_Sec2, FR_Ch2_Sec3, etc.)
I'm trying to JOIN these two tables on topics. For example, if Resources.RES_Topic_Sports = 1, I want to join ChapterMap where ChapterMap.Topic = 'Sports'. IF Resources.RES_Topic_Sports = 1 AND Resources.RES_Topic_Politics = 1, I want to join ChapterMap where ChapterMap.Topic = 'Sports' AND where ChapterMap.Topic = 'Politics', etc., etc.
I'm also open to restructuring the tables if that's optimal.
I would be VERY grateful for any advice. If it matters, this is for a non-profit organization that works on global human rights issues.
Thanks in advance!!
******************** SAMPLE DATA **********************
Table: RESOURCES
Fields: RES_ID, RES_Name, RES_Topic_Sports, RES_Topic_Politics, RES_Topic_CurrentEvents
Record: (101, 'Sports Lesson Plan', 1, NULL, 1)
Explanation: A resource called "Sports Lesson Plan" that relates to the Sports and Current Events topics.
Table: CHAPTERMAP
Fields: ID, Topic, Ch1_Sec1, Ch1_Sec2, Ch1_Sec3, Ch1_Sec4, Ch2_Sec1, Ch2_Sec2, Ch3_Sec1, Ch3_Sec2, Ch3_Sec3
Record: (4, 'Sports', NULL, NULL, NULL, NULL, 1, NULL, NULL, 1, 1)
Explanation: A mapping that links the topic "Sports" to Chapter 2, Section 1 and to Chapter 3, Section 2 and to Chapter 3, Section 3.
GOAL: To link the resource "Sports Lesson Plan" to Chapter 2, Section 1 and to Chapter 3, Section 2 and to Chapter 3, Section 3.