I'm stuck on question 2 for a homework assignment, I've asked my professor who gave an example on how to do it and some classmates but still no luck. For some reason subqueries just don't register with me at all and we have to use a subquery to show this.. Any thoughts SQL GAF?
Use a subquery to display the employee identification number and employee name of all employees of the production department.
SELECT EMPLOYEE_ID, EMPLOYEE_NAME, DEPARTMENT_ID, DEPARTMENT_NAME
FROM EMPLOYEES
WHERE DEPARTMENT_NAME IN (SELECT DEPARTMENT_NAME
FROM DEPARTMENTS
WHERE DEPARTMENT_NAME = PRODUCTION);
And I get the error "quoted string not properly terminated". My question is am I even somewhat close here?
The tables are EMPLOYEES and DEPARTMENTS. EMPLOYEES contains the employee_id, employee_name, while the DEPARTMENTS table contains department_id and department_name.
Use a subquery to display the employee identification number and employee name of all employees of the production department.
SELECT EMPLOYEE_ID, EMPLOYEE_NAME, DEPARTMENT_ID, DEPARTMENT_NAME
FROM EMPLOYEES
WHERE DEPARTMENT_NAME IN (SELECT DEPARTMENT_NAME
FROM DEPARTMENTS
WHERE DEPARTMENT_NAME = PRODUCTION);
And I get the error "quoted string not properly terminated". My question is am I even somewhat close here?
The tables are EMPLOYEES and DEPARTMENTS. EMPLOYEES contains the employee_id, employee_name, while the DEPARTMENTS table contains department_id and department_name.