Integrate Denelezh statistics, i.e. per-professions stats.
Merge all current tables into a single one:
CREATE TABLE persons ( date TEXT NOT NULL, qid TEXT NOT NULL, birth_year INT NOT NULL, gender_id TEXT NOT NULL REFERENCES gender_labels (qid) ON DELETE RESTRICT, PRIMARY KEY (date, wiki_name, wiki_lang, country_id, profession_id, gender_id) ) STRICT; CREATE TABLE persons_countries ( date TEXT NOT NULL, person_id TEXT NOT NULL, country_id TEXT NOT NULL REFERENCES countries (qid) ON DELETE RESTRICT, FOREIGN KEY (date, person_id) REFERENCES persons (date, qid) ON DELETE RESTRICT, PRIMARY KEY (date, person_id, country_id) ) STRICT; CREATE TABLE persons_professions ( date TEXT NOT NULL, person_id TEXT NOT NULL, profession_id TEXT NOT NULL REFERENCES professions (qid) ON DELETE RESTRICT, FOREIGN KEY (date, person_id) REFERENCES persons (date, qid) ON DELETE RESTRICT, PRIMARY KEY (date, person_id, profession_id) ) STRICT;
Pro:
- Makes it possible to build queries combining multiple criteria.
- Easier to query from the search page.
Cons:
- The database’s size may increase substentially because of no longer aggregating human elements.