mysociety / pombola

GNU Affero General Public License v3.0
65 stars 41 forks source link

KE: "Student" positions at Educational Organisations should be 'category: education' #1987

Open tmtmtmtm opened 8 years ago

tmtmtmtm commented 8 years ago

For positions that have a title matching 'Student', at an Organisation that is marked as Educational, the category of that organisation should presumably almost always be "Education (as a learner)", but not all are:

 category  | howmany 
-----------+---------
 education |    1327
 other     |      98
 political |      10

via

SELECT p.category, COUNT(*) AS howmany
  FROM core_person mp
  LEFT JOIN core_position p ON mp.id = p.person_id
  LEFT JOIN core_positiontitle t ON p.title_id = t.id
  LEFT JOIN core_place a ON a.id = p.place_id
  LEFT JOIN core_placekind pk ON a.kind_id = pk.id
  LEFT JOIN core_organisation o ON p.organisation_id = o.id
  LEFT JOIN core_organisationkind ok ON o.kind_id = ok.id
 WHERE o.kind_id = 4
   AND t.name ilike '%student'
 GROUP BY p.category
 ORDER BY howmany DESC
tmtmtmtm commented 8 years ago

ones to correct:

  id   |            legal_name            |                              organisation                               |           role           | category  
-------+----------------------------------+-------------------------------------------------------------------------+--------------------------+-----------
   459 | Abraham Korir Sing’oei           | University of Minnesota, Humphrey Institute of Public Affairs,          | Graduate Student         | other
   291 | Athanas Misiko Wafula Wamunyinyi | London Business School                                                  | Graduate Student         | other
  1007 | Christine Oduor Ombaka           | Irish International University                                          | Graduate Student         | other
   268 | Daudi Fredrick Mwanzia           | University of Reading, UK                                               | Graduate Student         | other
   141 | David Eseli Simiyu               | Tel Aviv University, Israel                                             | Graduate Student         | other
   477 | David Githii Muhia               | Dubugue University, USA                                                 | Graduate Student         | other
 13150 | Davis Chirchir                   | University of London                                                    | Graduate Student         | other
 13147 | Felix Kiptarus Koskei            | University of Brunswick, Canada.                                        | Graduate Student         | other
 13147 | Felix Kiptarus Koskei            | University of Botswana                                                  | Graduate Student         | other
    10 | Francis S. K. Baya               | Institute of Financial Analysts of India (ICFAI)                        | Graduate Student         | other
  1147 | Geofrey Lipale                   | Kenyatta University                                                     | Graduate Student         | other
  1096 | Jackson Kiplagat Mandago         | Kenyatta University                                                     | Graduate Student         | other
   470 | James Nyoro                      | University of Ghent, Belgium.                                           | Graduate Student         | other
   470 | James Nyoro                      | University of London                                                    | Graduate Student         | other
  1174 | Jared Odhiambo Opiyo             | Kenyatta University                                                     | Graduate Student         | other
   424 | Joseph Tiampati Musuni           | Maastricht University                                                   | Graduate Student         | other
   473 | Kassim Riga Mambo                | Byelorussia State University                                            | Graduate Student         | other
   417 | Kenneth Lusaka                   | Institute of Social Studies (ISS), the Hague                            | Graduate Student         | other
    33 | Margaret Jepkoech Kamar          | University of Toronto, Canada                                           | Graduate Student         | other
    33 | Margaret Jepkoech Kamar          | McGill University, Canada                                               | Graduate Student         | political
   453 | Mohammed Konso Hallo             | Open University, Denmark                                                | Graduate Student         | other
   453 | Mohammed Konso Hallo             | Open University, Denmark                                                | Graduate Student         | other
   453 | Mohammed Konso Hallo             | Marquette University, USA-Les Aspen Centre for Democracy and Governance | Graduate Student         | other
   453 | Mohammed Konso Hallo             | Marquette University, USA-Les Aspen Centre for Democracy and Governance | Graduate Student         | other
  1979 | Rachael Kaki Nyamai              | University of Aarhus, Denmark                                           | Graduate Student         | other
   488 | Shem Ochuodho                    | University of York , UK                                                 | Graduate Student         | other
  3036 | Timothy Wanyonyi Wetangula       | University of Delhi, India                                              | Graduate Student         | other
   404 | William Kipkemboi kirwa          | Birmingham Business School                                              | Graduate Student         | other
   252 | Ali Wario                        | Mororo Primary School                                                   | Primary School Student   | other
    25 | Benedict Fondo Gunda             | Chije Primary School                                                    | Primary School Student   | other
    25 | Benedict Fondo Gunda             | Kizingo Primary School                                                  | Primary School Student   | other
    43 | Emilio Mwai Kibaki               | Gatuyaini Village School                                                | Primary School Student   | political
   840 | Florence Kajuju                  | Mucuune Primary School                                                  | Primary School Student   | other
    18 | Francis Chachu Ganya             | North Horr Primary School                                               | Primary School Student   | other
   305 | Gideon Kipsiele Towett Moi       | Kenton College Preparatory School                                       | Primary School Student   | other
  1335 | Gideon Mwiti Irea                | Ruiga Primary School, Meru                                              | Primary School Student   | other
  1345 | Omar Mwinyi Shimbwa              | Bomu Primary School                                                     | Primary School Student   | other
    68 | Raphael Lakalei Letimalo         | Wamba DEB Primary School                                                | Primary School Student   | other
  1356 | Wesley Kipchumba Korir           | Biribiriet Primary School                                               | Primary School Student   | other
   459 | Abraham Korir Sing’oei           | Kabarak High School                                                     | Secondary School Student | other
    15 | Aden Bare Duale                  | Moi Forces Academy                                                      | Secondary School Student | other
    15 | Aden Bare Duale                  | Garissa High School                                                     | Secondary School Student | other
   252 | Ali Wario                        | Tarasaa High School                                                     | Secondary School Student | other
    25 | Benedict Fondo Gunda             | Shimo La Tewa Secondary School                                          | Secondary School Student | other
   198 | Chrysanthus Barnabas Okemo       | St. Pauls Amukura High School                                           | Secondary School Student | other
   283 | David Mwiraria                   | Alliance High School                                                    | Secondary School Student | other
  2648 | David Njuguna Kiaraho            | Alliance High School                                                    | Secondary School Student | political
   125 | Elizabeth Ongoro Masha           | Lwak Girls High School                                                  | Secondary School Student | other
   125 | Elizabeth Ongoro Masha           | Rangala Girls High School                                               | Secondary School Student | other
    18 | Francis Chachu Ganya             | Moyale Secondary School                                                 | Secondary School Student | other
   436 | Grace Mwewa                      | Masii Secondary School                                                  | Secondary School Student | other
    87 | Isaac Mulatya Muoki              | Maseno School                                                           | Secondary School Student | other
   135 | James Kwanya Rege                | Nairobi School, Kenya                                                   | Secondary School Student | other
   303 | Jimmy Choge                      | Lenana School                                                           | Secondary School Student | other
   273 | John Mutinda Mutiso              | Kanunga boys school                                                     | Secondary School Student | other
   248 | Joseph Kahindi Kingi             | Ribe Secondary School                                                   | Secondary School Student | other
    73 | Joseph Oyugi Magwanga            | Ringa Secondary School                                                  | Secondary School Student | other
   417 | Kenneth Lusaka                   | Friends School, Kamusinga                                               | Secondary School Student | other
   417 | Kenneth Lusaka                   | Chesamisi High School                                                   | Secondary School Student | other
  1377 | Mohamed Dahir Duale              | Garbatula High School                                                   | Secondary School Student | other
    67 | Moses Lessonet                   | Nairobi School, Kenya                                                   | Secondary School Student | political
    67 | Moses Lessonet                   | Moi High School - Kabarak                                               | Secondary School Student | political
    68 | Raphael Lakalei Letimalo         | Maralal High School                                                     | Secondary School Student | other
   463 | Suleiman Shahbal                 | Nairobi School, Kenya                                                   | Secondary School Student | other
  3036 | Timothy Wanyonyi Wetangula       | Nairobi School, Kenya                                                   | Secondary School Student | other
  3036 | Timothy Wanyonyi Wetangula       | Kibabii High School                                                     | Secondary School Student | other
    11 | Yusuf Kifuma Chanzu              | Kakamega High School                                                    | Secondary School Student | other
  7857 | Abdalla Mohamed Kasangamba       | Mombasa Aviation College                                                | Student                  | political
   291 | Athanas Misiko Wafula Wamunyinyi | Kenya Institute of Management (KIM)                                     | Student                  | other
   444 | Augostinho Neto Oyugi            | Alliance Francaise de Nairobi                                           | Student                  | other
 12650 | Charles Kamau Wanguhu            | Stanford University, USA                                                | Student                  | other
  1162 | Cornelly Serem                   | Donnelly College, USA                                                   | Student                  | other
   101 | Danson Mwazo Mwakulegwa          | River State University                                                  | Student                  | other
   283 | David Mwiraria                   | International Statistical Institute, Calcutta, India                    | Student                  | other
   539 | Florence Mwikali Mutua           | Wote College                                                            | Student                  | other
  1510 | Francis Kigo Njenga              | Kenya Institute of Management (KIM)                                     | Student                  | other
 13132 | Janet Marania Teiyaa             | Enoomatasiani Mixed Boarding School                                     | Student                  | other
 13132 | Janet Marania Teiyaa             | Maasai Technical Institute                                              | Student                  | other
  2773 | Lisamula Silverse Anami          | Associated Board of the Royal Schools of Music (UK)                     | Student                  | other
   453 | Mohammed Konso Hallo             | International Institute of Rural Reconstruction (IIRR), Philippines     | Student                  | other
   453 | Mohammed Konso Hallo             | International Institute of Rural Reconstruction (IIRR), Philippines     | Student                  | other
 10596 | Pauline Wairimu Kariuki          | Platt Institute, New York, USA                                          | Student                  | other
  1485 | Peter Safari Shehe               | International Computer Kenya Ltd, Kenya                                 | Student                  | other
  1485 | Peter Safari Shehe               | Alpura, Switzerland                                                     | Student                  | other
  1485 | Peter Safari Shehe               | Kaufmann, Switzerland                                                   | Student                  | other
  1149 | Regina Nyeris Changorok          | Nasokol High School                                                     | Student                  | other
   578 | Shukran Hussein Gure             | University of St Catherine                                              | Student                  | other
   751 | Zainab Kalekye Chidzuga          | Mwijo primary school                                                    | Student                  | other
    15 | Aden Bare Duale                  | Moi University                                                          | Undergraduate Student    | other
   243 | Anania Mwasambu Mwaboza          | Marathwada University                                                   | Undergraduate Student    | other
  1272 | Ben George Orori Momanyi         | Marathwada University, India                                            | Undergraduate Student    | other
  1247 | Benard Kipkirui Bett             | Moi University                                                          | Undergraduate Student    | other
   477 | David Githii Muhia               | St. Paul University, USA                                                | Undergraduate Student    | other
  2918 | Elisha Kipkorir Busienei         | Mt. Kenya University                                                    | Undergraduate Student    | other
    18 | Francis Chachu Ganya             | St. Lawrence University                                                 | Undergraduate Student    | other
  1147 | Geofrey Lipale                   | Kenyatta University                                                     | Undergraduate Student    | other
  1147 | Geofrey Lipale                   | University of Southern Africa                                           | Undergraduate Student    | other
  1147 | Geofrey Lipale                   | Kenyatta University                                                     | Undergraduate Student    | other
   305 | Gideon Kipsiele Towett Moi       | Stafford University, USA                                                | Undergraduate Student    | other
 13129 | Isaac Maigua Mwaura              | Kenyatta University                                                     | Undergraduate Student    | political
 13129 | Isaac Maigua Mwaura              | Kenyatta University                                                     | Undergraduate Student    | political
   874 | Mishi Juma Khamisi               | Moi University                                                          | Undergraduate Student    | other
   486 | Mohamed Abduba Dida              | Kenyatta University                                                     | Undergraduate Student    | political
  1274 | Patrick Kibagendi Osero          | Jomo Kenyatta University of Agriculture & Technology (JKUAT)            | Undergraduate Student    | political
   947 | Samuel Abuga Mweberi             | Delaware Tech                                                           | Undergraduate Student    | other
    21 | Stanley Munga Githunguri         | Alaska Methodist University                                             | Undergraduate Student    | other
  3036 | Timothy Wanyonyi Wetangula       | Punjab University, Chandigah, India                                     | Undergraduate Student    | other
   911 | Zipporah Jesang Kurgat Kering    | Kenyatta University                                                     | Undergraduate Student    | other
(108 rows)

via

SELECT mp.id, mp.legal_name, o.name AS organisation, t.name AS role, p.category
  FROM core_person mp
  LEFT JOIN core_position p ON mp.id = p.person_id
  LEFT JOIN core_positiontitle t ON p.title_id = t.id
  LEFT JOIN core_place a ON a.id = p.place_id
  LEFT JOIN core_placekind pk ON a.kind_id = pk.id
  LEFT JOIN core_organisation o ON p.organisation_id = o.id
  LEFT JOIN core_organisationkind ok ON o.kind_id = ok.id
 WHERE o.kind_id = 4
   AND t.name ilike '%student'
   AND p.category != 'education'
 ORDER BY t.name, mp.legal_name;