How to check if username in database exists with sqlite3 python

I am currently building my app and I need some help on the delete function which deletes a user from the database through a password and username. Currently the delete function works halfway but it can't check to see whether a user exists in the database. Here's the function syntax:

def delete_user_admin(self):

    if len(self.user_admin.get()) == 0 or self.admin_password.get() != '1111':
        tkinter.messagebox.showerror("Quiz App - Error", "Missing inputs or wrong password!")

    elif self.admin_password.get() == '1111':
        with sqlite3.connect("userdata.db") as db:
            cursur_delete = db.cursor()

        delete_user_statement = "DELETE FROM quizdata WHERE username = ?"
        cursur_delete.execute(delete_user_statement, [self.user_admin.get()])

        tkinter.messagebox.showinfo("Quiz App - Information", "User deleted!")

        self.admin_password_entry.delete(0, 'end')
        self.user_entry_field.delete(0, 'end')
        db.commit()
        db.close()

    else:

        with sqlite3.connect("userdata.db") as db:

            cursur_exists = db.cursor()
            cursur_exists_statement = \
                "SELECT EXISTS(SELECT 1 FROM quizdata WHERE username = ? COLLATE NOCASE) LIMIT 1"
            cursur_exists.execute(cursur_exists_statement, [self.user_admin.get()])
            if cursur_exists.fetchone()[0] == 0:

                tkinter.messagebox.showerror("Quiz App - Error", "User not exists!")

                db.commit()
                db.close()
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum