查询“联华公司”中低于本公司平均工资的职工号和姓名。
SELECT E#,ENAME FROM EMP WHERE E# IN (SELECT E# FROM WORKS WHERE C# IN (SELECT C# FROM COMP WHERE CNAME=’联华公司’) AND SALARY<(SELECT AVG(SALARY) FROM WORKS WHERE C# IN (SELECT C# FROM COMP WHERE CNAME=’联华公司’);
查询“联华公司”中低于本公司平均工资的职工号和姓名。
SELECT E#,ENAME FROM EMP WHERE E# IN (SELECT E# FROM WORKS WHERE C# IN (SELECT C# FROM COMP WHERE CNAME=’联华公司’) AND SALARY<(SELECT AVG(SALARY) FROM WORKS WHERE C# IN (SELECT C# FROM COMP WHERE CNAME=’联华公司’);