def normalize_database(non_normalized_db_filename):
    
    conn_normalized = create_connection('normalized.db', True)

    create_table_Degree = """CREATE TABLE IF NOT EXISTS [Degrees](Degree TEXT NOT NULL PRIMARY KEY);"""
    
    
    create_table(conn_normalized, create_table_Degree)
    
    

    create_table_Exam = """CREATE TABLE IF NOT EXISTS [Exams](Exam TEXT NOT NULL PRIMARY KEY, Year INT NOT NULL);"""

    create_table(conn_normalized, create_table_Exam)

   
    create_table_Students = """CREATE TABLE IF NOT EXISTS [Students](StudentID INTEGER NOT NULL PRIMARY KEY, First_Name TEXT NOT NULL , Last_Name TEXT NOT NULL,Degree TEXT NOT NULL, FOREIGN KEY(Degree) REFERENCES Degrees(Degree));"""
     
    create_table(conn_normalized, create_table_Students)

    create_table_StudentsExamScores = """CREATE TABLE IF NOT EXISTS [StudentsExamScores](PK INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ,StudentID INTEGER NOT NULL, Exam TEXT NOT NULL, Score INTEGER NOT NULL,FOREIGN KEY(StudentID) REFERENCES Students(StudentID), FOREIGN KEY(Exam) REFERENCES Exams(Exam));"""
     
    create_table(conn_normalized, create_table_StudentsExamScores)
    
    conn_non_normalized = create_connection(non_normalized_db_filename , False)
    select_degree = '''SELECT DISTINCT Degree FROM Students''' 
    select_exams = ''' SELECT  Exams FROM Students'''
    select_students = '''SELECT StudentID,Name,Degree From Students'''
    students = execute_sql_statement(select_students,conn_non_normalized)
#     print(students)
    stu = [(id, name.split(',')[0].strip(), name.split(',')[1].strip(), degree) for id, name, degree in students]
    st = tuple(stu) 
#     print(st)
    slect_s = '''SELECT Scores FROM Students'''
    scores = execute_sql_statement(slect_s,conn_non_normalized)
    slect_id = '''SELECT StudentID FROM Students'''
    sid = execute_sql_statement(slect_id,conn_non_normalized)
#     print(sid)
    sids = []
    for sco in sid:
        for i in sco:
            sids.append(i)
#     print(sids)
    
#     print(scores)
    scor = []
    for sco in scores:
        for i in sco:
            scor.append(i.split(","))
#     print(scor)
    c = []
    for sublist in scor:
        new_sublist = []
        for item in sublist:
            new_sublist.append(int(item.strip()))
        c.append(new_sublist)
#     print(c)
    degrees = execute_sql_statement(select_degree,conn_non_normalized)
#     print(degrees)
    tup = []
    for i in degrees:
        for j in i:
            tup.append(j)
    deg = tuple(tup)
    exams = execute_sql_statement(select_exams ,conn_non_normalized)
#     print(exams)
    k =[]
    for i in exams:
        for j in i:
            x = j.split(',')
            k.append(x)
    m = []
    for i in k:
        for j in i:
            if j not in m:
                m.append(j)
    o = [(s.split()[0], int(s.split()[1].strip('()'))) for s in m]
    ex =  []
    for j in k:
        lo = []
        for l in j:
            lo.append(l.split('(')[0].strip())
        ex.append(lo)
#     print(ex)
            
    p = []
#     print(o)
    for i in o:
        if i not in p:
            p.append(i)
            
    p = tuple(p)
    
#     print(p)
    final = []
#     print(len(sids),len(ex),len(c))
    for i,z,k in zip(sids,ex,c):
       
        for o in range(len(z)):
            yell = []
            yell.append(i)
            yell.append(z[o])
            yell.append(k[o])
            final.append(tuple(yell))
    print(final)
  
    
    
    
   
    

    def insert_degrees(conn_normalized, values):
        sql = ''' INSERT INTO Degrees(Degree)
                VALUES(?) '''
        cur = conn_normalized.cursor()
        cur.execute(sql, values)
        return cur.lastrowid
    def insert_exams(conn_normalized, values):
        sql = ''' INSERT INTO Exams(Exam,Year)
                VALUES(?,?) '''
        cur = conn_normalized.cursor()
        cur.execute(sql, values)
        return cur.lastrowid
    def insert_students(conn_normalized, values):
        sql = ''' INSERT INTO Students(StudentID,First_Name,Last_Name,Degree)
                VALUES(?,?,?,?) '''
        cur = conn_normalized.cursor()
        cur.execute(sql, values)
        return cur.lastrowid
    def insert_studentexamscores(conn_normalized, values):
        sql = ''' INSERT INTO StudentsExamScores(StudentID,Exam,Score)
                VALUES(?,?,?) '''
        cur = conn_normalized.cursor()
        cur.execute(sql, values)
        return cur.lastrowid
    
    with conn_normalized:
            for i in p:
                insert_exams(conn_normalized,i)
            for i in deg:
                insert_degrees(conn_normalized,(i,))
            for i in st:
                insert_students(conn_normalized,i)
            for i in final:
                insert_studentexamscores(conn_normalized,i)


Can you rewrite the code above into another way much simpler way, using comprehensions something like that but FUNCATIONALITY SHOULD REMAIN SAME AS ABOVE CODE FUNCTIONALITY