def get_students(selection_db, aws_db, applicants_sql, student_fields_sql):
    """
    Calls the database and gets student information.
    Input: database connection object, SQL query, dict of fields name/ID
    Returns: dictionary of student information, key=student ID
    """
    students = {}

    with selection_db.cursor() as cursor:
        cursor.execute(applicants_sql)
        for last, first, id, f1, f2, f3, comment \
                in cursor.fetchall():
            faculty = [f1, f2, f3]
            cores = []
            minors = []
            students[id] = {"name": f"{last} {first}", "faculty": faculty, "core": cores, "minor": minors, "match": {}, "comment": comment
                            }

    with aws_db.cursor() as cursor:
        cursor.execute(student_fields_sql)
        for user_id, field_id, major in cursor.fetchall():
            if major == 1:
                students[user_id]["core"].append(field_id)
            else:
                students[user_id]["minor"].append(field_id)

    return students