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, "")
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, "")
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")
def all_data_mentors(cursor): cursor.execute("""SELECT * FROM mentors ORDER BY id;""") return common.print_query_table(cursor, "All the mentors")
def firstname_lastname_mentors(cursor): cursor.execute("""SELECT first_name, last_name FROM mentors;""") return common.print_query_table(cursor, "")
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, "")
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, "")
def nickname_miskolc_mentors(cursor): cursor.execute(""" SELECT nick_name FROM mentors WHERE city = 'Miskolc' ;""") return common.print_query_table(cursor, "")