Question: Write and execute a SQL query that returns the age and salary of employees with salary greater than $20,000 and less than $55,000 ordered by
Write and execute a SQL query that returns the age and salary of employees with salary greater than $20,000 and less than $55,000 ordered by salary descending.
Make a connection to MySQL database with this connection information:
cnx = mysql.connector.connect(user='', password='', host='', database='WorksOn')
schema:
emp (eno CHAR(5), ename VARCHAR(30), bdate DATE, title CHAR(2), salary DECIMAL(9,2), supereno CHAR(5), dno CHAR(5), PRIMARY KEY (eno)) dept (dno CHAR(5), dname VARCHAR(40), mgreno CHAR(5), PRIMARY KEY (dno)) -- mgreno is the employee number of the manager of the department (may join with emp) proj (pno CHAR(5), pname VARCHAR(40), budget DECIMAL(9,2), dno CHAR(5), PRIMARY KEY (pno)) -- dno is the department that has the project (may join with dept) workson (eno CHAR(5), pno CHAR(5), resp VARCHAR(20), hours SMALLINT, PRIMARY KEY (eno,pno)) -- Use eno to join with emp. Use pno to join with proj.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
