MySQL Workbench Will the following select statements work? If the queries don’t work, explain why and then correct them. a-) SELECT NAME, EMPLOYEE_ID, SALARY FROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EP WHERE EMPLOYEE_ID = EMPLOYEE_ID AND NAME LIKE '%MITH'; b-) SELECT E.NAME, E.EMPLOYEE_ID, EP.SALARY FROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EP WHERE NAME LIKE '%MITH'; c-) SELECT E.NAME, E.EMPLOYEE_ID, EP.SALARY FROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EP WHERE E.EMPLOYEE_ID = EP.EMPLOYEE_ID AND E.NAME LIKE '%MITH'; d-) SELECT ENAME, COUNT(*) FROM EMP WHERE ENAME = '&NAME' ORDER BY ENAME; e-) SELECT DEPT_ID, COUNT(*) FROM EMP GROUP BY DEPT_ID HAVING ENAME='ALIYE'; f-) SELECT F_NAME, L_NAME WHERE F_NAME LIKE '%A' FROM EMP, DEPT; g-) SELECT NAME, SALARY FROM DEPT, EMP WHERE DEPT.ID = EMP.ID AND SUM(SALARY);
MySQL Workbench
Will the following select statements work? If the queries don’t work, explain why and then correct them.
a-) SELECT NAME, EMPLOYEE_ID, SALARY
FROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EP
WHERE EMPLOYEE_ID = EMPLOYEE_ID AND NAME LIKE '%MITH';
b-) SELECT E.NAME, E.EMPLOYEE_ID, EP.SALARY
FROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EP
WHERE NAME LIKE '%MITH';
c-) SELECT E.NAME, E.EMPLOYEE_ID, EP.SALARY
FROM EMPLOYEE_TBL E, EMPLOYEE_PAY_TBL EP
WHERE E.EMPLOYEE_ID = EP.EMPLOYEE_ID AND E.NAME LIKE '%MITH';
d-) SELECT ENAME, COUNT(*)
FROM EMP
WHERE ENAME = '&NAME'
ORDER BY ENAME;
e-) SELECT DEPT_ID, COUNT(*)
FROM EMP
GROUP BY DEPT_ID
HAVING ENAME='ALIYE';
f-) SELECT F_NAME, L_NAME
WHERE F_NAME LIKE '%A'
FROM EMP, DEPT;
g-) SELECT NAME, SALARY
FROM DEPT, EMP
WHERE DEPT.ID = EMP.ID AND SUM(SALARY);
Step by step
Solved in 9 steps