Database schema:

CREATE TABLE cites (
	cited_paper_id TEXT NOT NULL -- example: ['100157', '100598'],
	citing_paper_id TEXT NOT NULL -- example: ['364207', '100157'],
	PRIMARY KEY (cited_paper_id, citing_paper_id)
)


CREATE TABLE content (
	paper_id TEXT NOT NULL -- example: ['100157', '100598'],
	word_cited_id TEXT NOT NULL -- example: ['word1163', 'word1509'],
	PRIMARY KEY (paper_id, word_cited_id), 
	CONSTRAINT fk_content_paper FOREIGN KEY(paper_id) REFERENCES paper (paper_id)
)


CREATE TABLE paper (
	paper_id TEXT NOT NULL -- example: ['100157', '100598'],
	class_label TEXT NOT NULL -- example: ['IR', 'Agents'],
	PRIMARY KEY (paper_id)
)

Question: For all words cited in paper ID 315017, state the other paper ID and class label which also cited those words.

SQL:
SELECT T1.class_label, T2.word_cited_id FROM paper AS T1 INNER JOIN content AS T2 ON T1.paper_id = T2.paper_id WHERE T1.paper_id = 315017