def pupil_data_design_doc(database):
    """
    Returns:
        Query: 'pupil_data' design document containing a single view called
        'list_pupils' which is keyed with `(parent, school)`.
    """
    query = database.get_query("pupil_data")
    query.data = {
        "views": {
            "list_pupils": {
                "map":
                """
function (doc,meta) {
    if(doc.type == "pupil") {
        emit([doc.parent, doc.school], doc);
    }
}
""",
            },
        },
    }
    query.create_update()
    return query