working with the pymysql module into individual elements these elements could then be used to construct an object that could then be processed within an applicationfor examplefor row in dataidnamesurnamesubjectemail row student student(idnamesurnamesubjectemailprint(studentclose the connection once you have finished with the database connection it should be closed disconnect from server connection close( complete pymysql query example complete listing illustrating connecting up to the databaserunning select statement and printing out the results using student class is given belowimport pymysql class studentdef __init__(selfidnamesurnamesubjectemail)self id id self name name self surname surname self subject subject self email email def __str__(self)return 'student[str(id'name surname subject email open database connection connection pymysql connect('localhost''user''password''uni-database'prepare cursor object using cursor(method cursor connection cursor(