Q. Write a program to display all records in ascending order of their salary.


Answer =


import mysql.connector as a
mydb = a.connect(host="localhost",user="root",password="portal express", database = " Path_wala ")

cur = mydb.cursor()
run = "select * from Path_wala order by salary  "
cur . execute(run)
data = cur.fetchall()
for i in data :
    print(i)
mydb.close()



Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post