Wiki How:People by year/SQL to find people categories

DROP TABLE IF EXISTS temp_peoplecats;CREATE TABLE `temp_peoplecats` (  `ct_from_name` varchar(255) binary NOT NULL default '',  `ct_from` int(8) unsigned NOT NULL default '0',  `ct_to` varchar(255) binary NOT NULL default '',  `ct_sortkey` varchar(255) binary NOT NULL default '',  PRIMARY KEY  (`ct_from`,`ct_to`)) TYPE=MyISAM; INSERT INTO temp_peoplecats VALUES ('People', 691008, 'People', 'People');
Repeat the following for the number of levels to be included:
INSERT IGNORE    temp_peoplecatsSELECT DISTINCT  cur_title, cl_from, cl_to, cl_sortkeyFROM  categorylinks, cur, temp_peoplecatsWHERE cl_to = ct_from_nameAND   cl_from=cur_idAND   cur_namespace=14;DELETE FROM temp_peoplecats WHERE ct_from_name LIKE 'Lists%';