Database schema:

CREATE TABLE biwords (
	lid INTEGER NOT NULL -- example: ['1'],
	w1st INTEGER NOT NULL -- example: ['2', '1'],
	w2nd INTEGER NOT NULL -- example: ['2', '4'],
	occurrences INTEGER DEFAULT 0 -- example: ['4', '3'],
	PRIMARY KEY (lid, w1st, w2nd), 
	CONSTRAINT fk_biwords_words FOREIGN KEY(w2nd) REFERENCES words (wid),
	CONSTRAINT fk_biwords_words FOREIGN KEY(w1st) REFERENCES words (wid),
	CONSTRAINT fk_biwords_langs FOREIGN KEY(lid) REFERENCES langs (lid)
)


CREATE TABLE langs (
	lid INTEGER -- example: ['1'],
	lang TEXT -- example: ['ca'],
	locale TEXT -- example: ['ca_ES'],
	pages INTEGER DEFAULT 0 -- example: ['1129144'],
	words INTEGER DEFAULT 0 -- example: ['2764996'],
	PRIMARY KEY (lid), 
	UNIQUE (lang), 
	UNIQUE (locale)
)


CREATE TABLE langs_words (
	lid INTEGER NOT NULL -- example: ['1'],
	wid INTEGER NOT NULL -- example: ['2', '1'],
	occurrences INTEGER -- example: ['242', '16841'],
	PRIMARY KEY (lid, wid), 
	CONSTRAINT fk_langs_words_words FOREIGN KEY(wid) REFERENCES words (wid),
	CONSTRAINT fk_langs_words_langs FOREIGN KEY(lid) REFERENCES langs (lid)
)


CREATE TABLE pages (
	pid INTEGER -- example: ['2', '1'],
	lid INTEGER -- example: ['1'],
	page INTEGER DEFAULT NULL -- example: ['2', '1'],
	revision INTEGER DEFAULT NULL -- example: ['28236978', '24086480'],
	title TEXT -- example: ['Àbac', 'Abadia'],
	words INTEGER DEFAULT 0 -- example: ['1081', '68'],
	PRIMARY KEY (pid), 
	CONSTRAINT fk_pages_langs FOREIGN KEY(lid) REFERENCES langs (lid),
	UNIQUE (lid, page, title)
)


CREATE TABLE pages_words (
	pid INTEGER NOT NULL -- example: ['2', '1'],
	wid INTEGER NOT NULL -- example: ['2', '1'],
	occurrences INTEGER DEFAULT 0 -- example: ['30', '8'],
	PRIMARY KEY (pid, wid), 
	CONSTRAINT fk_pages_words_words FOREIGN KEY(wid) REFERENCES words (wid),
	CONSTRAINT fk_pages_words_pages FOREIGN KEY(pid) REFERENCES pages (pid)
)


CREATE TABLE words (
	wid INTEGER -- example: ['2506463', '2148990'],
	word TEXT -- example: ['+,2', '+,33'],
	occurrences INTEGER DEFAULT 0 -- example: ['242', '16841'],
	PRIMARY KEY (wid), 
	UNIQUE (word)
)

Question: Calculate the average percentage of word appearance in the page that have revision page id smaller than 106680.
Evidence: revision page id smaller than 106680 refers to revision < 106680; word appearance refers to occurrences; DIVIDE(SUM(occurrences where revision < 106680), COUNT(occurrences)) as percentage;

SQL:
SELECT CAST(SUM(T1.words) AS REAL) * 100 / SUM(T2.occurrences) FROM pages AS T1 INNER JOIN pages_words AS T2 ON T1.pid = T2.pid WHERE T1.revision < 106680