What is the second word in the pair of words number 1 and 8968?
Pair is a relationship of two words: w1st and w2nd, where w1st is word id of the first word and w2nd is a word id of the second word; w1st = 1; w2nd = 8968;
SELECT word FROM words WHERE wid = 8968
CREATE TABLE langs(lid    INTEGER PRIMARY KEY AUTOINCREMENT,
                            lang   TEXT UNIQUE,
                            locale TEXT UNIQUE,
                            pages  INTEGER DEFAULT 0,  -- total pages in this language
                            words  INTEGER DEFAULT 0);
CREATE TABLE sqlite_sequence(name,seq);
CREATE TABLE pages(pid INTEGER PRIMARY KEY AUTOINCREMENT,
                            lid INTEGER REFERENCES langs(lid) ON UPDATE CASCADE ON DELETE CASCADE,
                            page INTEGER DEFAULT NULL, -- wikipedia page id
                            revision INTEGER DEFAULT NULL, -- wikipedia revision page id
                            title TEXT,
                            words INTEGER DEFAULT 0, -- number of different words in this page
                            UNIQUE(lid,page,title));
CREATE TRIGGER ins_page AFTER INSERT ON pages FOR EACH ROW
        BEGIN
          UPDATE langs SET pages=pages+1 WHERE lid=NEW.lid;
        END;
CREATE TRIGGER del_page AFTER DELETE ON pages FOR EACH ROW
        BEGIN
          UPDATE langs SET pages=pages-1 WHERE lid=OLD.lid;
        END;
CREATE TABLE words(wid INTEGER PRIMARY KEY AUTOINCREMENT,
                            word        TEXT UNIQUE,
                            occurrences INTEGER DEFAULT 0);
CREATE TABLE langs_words(lid INTEGER REFERENCES langs(lid) ON UPDATE CASCADE ON DELETE CASCADE,
                                        wid INTEGER REFERENCES words(wid) ON UPDATE CASCADE ON DELETE CASCADE,
                                        occurrences INTEGER, -- repetitions of this word in this language
                                        PRIMARY KEY(lid,wid))
                                        WITHOUT ROWID;
CREATE TRIGGER ins_lang_word AFTER INSERT ON langs_words FOR EACH ROW
        BEGIN
          UPDATE langs SET words=words+1 WHERE lid=NEW.lid;
        END;
CREATE TRIGGER del_lang_word AFTER DELETE ON langs_words FOR EACH ROW
        BEGIN
          UPDATE langs SET words=words-1 WHERE lid=OLD.lid;
        END;
CREATE TABLE pages_words(pid INTEGER REFERENCES pages(pid) ON UPDATE CASCADE ON DELETE CASCADE,
                                        wid INTEGER REFERENCES words(wid) ON UPDATE CASCADE ON DELETE CASCADE,
                                        occurrences INTEGER DEFAULT 0, -- times this word appears into this page
                                        PRIMARY KEY(pid,wid))
                                        WITHOUT ROWID;
CREATE TRIGGER ins_page_word AFTER INSERT ON pages_words FOR EACH ROW
        BEGIN
          UPDATE pages SET words=words+1 WHERE pid=NEW.pid;
        END;
CREATE TRIGGER del_page_word AFTER DELETE ON pages_words FOR EACH ROW
        BEGIN
          UPDATE pages SET words=words-1 WHERE pid=OLD.pid;
        END;
CREATE TABLE biwords(lid    INTEGER REFERENCES langs(lid) ON UPDATE CASCADE ON DELETE CASCADE,
                                w1st   INTEGER REFERENCES words(wid) ON UPDATE CASCADE ON DELETE CASCADE,
                                w2nd   INTEGER REFERENCES words(wid) ON UPDATE CASCADE ON DELETE CASCADE,
                                occurrences INTEGER DEFAULT 0, -- times this pair appears in this language/page
                                PRIMARY KEY(lid,w1st,w2nd))
                                WITHOUT ROWID;
