def generate_sets_item_query(names, sets):
    """
    Builds a query with a specified number of sets.

    :param list names: The name of the workout item.
    :param int sets: The number of sets to generate in the query.
    :return: SQL compatible query as a string.
    """
    master_tuple_list = []
    for name in names:
        for index in range(1, sets + 1):
            master_tuple_list.append(('%s_set_%s' % (name, index), 'real'))
            master_tuple_list.append(('%s_set_%s_reps' % (name, index), 'integer'))
    return master_tuple_list