Пример #1
0
def add_new_applicant(cursor):
    cursor.execute("""
        INSERT INTO applicants (id, first_name, last_name, phone_number, email, application_code)
        VALUES (11, 'Markus', 'Schaffarzyk', '003620/725-2666', '*****@*****.**', 54823)
        ;""")
    cursor.execute("""
        SELECT * FROM applicants
        WHERE application_code = 54823
        ;""")
    return common.print_query_table(cursor, "")
Пример #2
0
def change_phonenumber(cursor):
    cursor.execute("""
        UPDATE applicants
        SET phone_number = '003670/223-7459'
        WHERE first_name = 'Jemima' AND last_name = 'Foreman'
        ;""")
    cursor.execute("""
        SELECT phone_number FROM applicants
        WHERE first_name = 'Jemima' AND last_name = 'Foreman'
        ;""")
    return common.print_query_table(cursor, "")
Пример #3
0
def all_data_applicants(cursor):
    # run the query
    cursor.execute("""SELECT * FROM applicants ORDER BY id;""")
    # return in table format
    return common.print_query_table(cursor, "All the applicants")
Пример #4
0
def all_data_mentors(cursor):
    cursor.execute("""SELECT * FROM mentors ORDER BY id;""")
    return common.print_query_table(cursor, "All the mentors")
Пример #5
0
def firstname_lastname_mentors(cursor):
    cursor.execute("""SELECT first_name, last_name FROM mentors;""")
    return common.print_query_table(cursor, "")
Пример #6
0
def another_girl_hat(cursor):
    cursor.execute("""
        SELECT concat(first_name, ' ', last_name) AS full_name, phone_number FROM applicants
        WHERE email LIKE '*****@*****.**'
        ;""")
    return common.print_query_table(cursor, "")
Пример #7
0
def carol_and_her_hat(cursor):
    cursor.execute("""
        SELECT concat(first_name, ' ', last_name) AS full_name, phone_number FROM applicants
        WHERE first_name = 'Carol'
        ;""")
    return common.print_query_table(cursor, "")
Пример #8
0
def nickname_miskolc_mentors(cursor):
    cursor.execute("""
        SELECT nick_name FROM mentors
        WHERE city = 'Miskolc'
        ;""")
    return common.print_query_table(cursor, "")