Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given a table structure as follows. Employees____ EmpNumber EmpFirstName EmpLast

ID: 3716771 • Letter: G

Question

Given a table structure as follows. Employees____ EmpNumber EmpFirstName EmpLastName EmpStreet Number PK EmpState Department ID EmpStart_Date FK Answer the following questions. (a) (10 points) Please show an SQL statement to find all employees who works for Department 2. In addition, we wish to see the first name and last name appear in a same column and in upper case with a space in between. The result set should look like the following. department_id JUSTIN BLAKE2 JAMES HOLDER 2 JOSHUA BLAKE 2 GREG MURRAY2

Explanation / Answer

Select EmpNumber, UPPER(EmpFirstName||' '||EmpLastName) name, Department_ID from Employees where Department_Id = 2;

This query should give you the result you are expecting
Explanation:
"UPPER()" will conver the strin gto upper case
"EmpFirstName||' '||EmpLastName" will concatenate with single space between them
"UPPER(EmpFirstName||' '||EmpLastName) name", will use name as alias for the coulmm
Finally "where Department_Id = 2;" will ensure it will filter for emplyees only work for department_id 2

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote