<commit_before><!-- Licensed under the BSD. See License.txt for full text.  -->

<?php

// Query to find students who can come to dinner

$queries = array(

        #query for shift soon but not checked in with us

        #query for missed shift

        "xxxxxxxx SELECT tshirt_size, count(tshirt_size) from students where times_complete = 't' group by tshirt_size;"
        => "find out needed t-shirt sizes for all students (does exclude ones not done with registration)",

    //Check whether this query should display activities with more than the desired number/if we want a separate query for it
        "actclick SELECT A.activity_id, A.desired_workers - (
        SELECT count(SS.activity_id)
        from student_shifts SS
        where SS.activity_id = A.activity_id
        ) as desired_workers
        from activity A
        where A.desired_workers >
        (
                SELECT count(SS.activity_id)
                from student_shifts SS
                where SS.activity_id = A.activity_id
        );"
        => "Check which activities don't have desired number of workers and determine how many - ugly but works",

    //This query should be changed to have activity_id and use id of -1 for the total, list by activity_id

        "actclick SELECT A.activity_id, (A.desired_workers - (
        SELECT count(SS.activity_id)
        from student_shifts SS
        where SS.activity_id = A.activity_id
        )) * (time_to_sec(TS.end_time) - time_to_sec(TS.start_time)) / 3600 as short_hours
        from activity A, time_slots TS
        where A.slot_id = TS.slot_id
        and A.desired_workers >
        (
                SELECT count(SS.activity_id)
                from student_shifts SS
                where SS.activity_id = A.activity_id
        );"
        => "Check which activities don't have desired number of workers and determine total time - ugly but works",<commit_msg>Potential last fix on query<commit_after><!-- Licensed under the BSD. See License.txt for full text.  -->

<?php

// Query to find students who can come to dinner

$queries = array(

        #query for shift soon but not checked in with us

        #query for missed shift

        "xxxxxxxx SELECT tshirt_size, count(tshirt_size) from students where times_complete = 't' group by tshirt_size;"
        => "find out needed t-shirt sizes for all students (does exclude ones not done with registration)",

    //Check whether this query should display activities with more than the desired number/if we want a separate query for it
        "actclick SELECT A.activity_id, A.desired_workers - (
        SELECT count(SS.activity_id)
        from student_shifts SS
        where SS.activity_id = A.activity_id
        ) as desired_workers, (A.desired_workers - (
        SELECT count(SS.activity_id)
        from student_shifts SS
        where SS.activity_id = A.activity_id
        )) * (time_to_sec(TS.end_time) - time_to_sec(TS.start_time)) / 3600 as additional_hours_needed
        from activity A, time_slots TS
        where A.slot_id = TS.slot_id
        and A.desired_workers >
        (
                SELECT count(SS.activity_id)
                from student_shifts SS
                where SS.activity_id = A.activity_id
        );"
        => "Check which activities don't have desired number of workers and determine how many - ugly but works",

    //This query should be changed to have activity_id and use id of -1 for the total, list by activity_id

        "actclick SELECT A.activity_id, (A.desired_workers - (
        SELECT count(SS.activity_id)
        from student_shifts SS
        where SS.activity_id = A.activity_id
        )) * (time_to_sec(TS.end_time) - time_to_sec(TS.start_time)) / 3600 as additional_hours_needed
        from activity A, time_slots TS
        where A.slot_id = TS.slot_id
        and A.desired_workers >
        (
                SELECT count(SS.activity_id)
                from student_shifts SS
                where SS.activity_id = A.activity_id
        );"
        => "Check which activities don't have desired number of workers and determine missing time - ugly but works",
{'fraction_non_alphanumeric': 0.06818181818181818, 'fraction_numerical': 0.0033849129593810446, 'mean_word_length': 2.317562149157979, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4283928', 'n_tokens_mistral': 1190, 'n_tokens_neox': 1110, 'n_words': 414}