新学sql,我现在想要找到所有“word” 的值全部一样的 “event” id, 例如 “event 0” 包括 (0, 'Community'), (0, 'Sale'),则需要找其他 x 也是一样的 (x, 'Community'), (x, 'Sale')不多不少 ,然后输出 这一对值(0,x),请问sql 应该怎么写?谢谢!
CREATE TABLE keyword
(
event INT NOT NULL REFERENCES event(eid),
word VARCHAR(50) NOT NULL,
PRIMARY KEY (event, word)
);
INSERT INTO keyword VALUES
(0, 'Community'),
(0, 'Sale'),
(1, 'Community'),
(1, 'Sale'),
(1, 'Snacks'),
(2, 'Modern'),
(2, 'Art'),
(2, 'Museum'),
(2, 'Painting'),
(3, 'Film'),
(3, 'Cinema'),
(3, 'Art'),
(3, 'Movie'),
(3, 'Screening'),
(5, 'Cooking'),
(5, 'Eating'),
(5, 'Dining'),
(5, 'Workshop'),
(6, 'International'),
(6, 'Music'),
(6, 'Plays'),
(6, 'Food'),
(7, 'Prison'),
(7, 'Tour'),
(8, 'Book'),
(8, 'Library'),
(8, 'Reading'),
(8, 'Literacy'),
(9, 'Nature'),
(9, 'Walking'),
(9, 'Exercise'),
(9, 'Hiking'),
(10, 'Festival'),
(10, 'Costume'),
(10, 'Party'),
(11, 'Typewriter'),
(11, 'Tablet'),
(12, 'Circus'),
(12, 'Festival'),
(12, 'Clown'),
(12, 'Plays'),
(12, 'Music'),
(13, 'Art'),
(13, 'Community'),
(13, 'Sale'),
(13, 'Craft'),
(14, 'Community'),
(14, 'Food'),
(14, 'Snacks'),
(14, 'Party'),
(15, 'Film'),
(15, 'Cinema'),
(15, 'Art'),
(15, 'Movie'),
(15, 'Screening');