0% found this document useful (0 votes)
7 views1 page

Employee Salary Range Query in Python

Uploaded by

hridyapuri7
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Employee Salary Range Query in Python

Uploaded by

hridyapuri7
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

#WAP TO DISPLAY INFORMATION ALL THE EMPLOYEES WHOSE SALARY IS GREATER THAN STARTVAL

#AND LESS THAN ENDVAL

import [Link]

mycon=[Link](
host="localhost",
user="root",
passwd="aps",
database="smsdb2"
)

mycursor=[Link]()

startsal=input("Enter Starting Salary")


endsal=input("Enter Ending Salary")

sql= "SELECT * FROM EMP WHERE EMPSAL > %s AND EMPSAL < %s"

[Link](sql,(startsal,endsal,))

myresult=[Link]()

print("Empid\tEmpname\tEmpSal")
for x in myresult:
print(x[0],"\t",x[1],"\t",x[2])

You might also like