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

Need help with the following SQL Statement. Which Employees live in the same sta

ID: 3694300 • Letter: N

Question

Need help with the following SQL Statement.

Which Employees live in the same state as each other? What are their names and where do they live.

Who is the youngest?

Salesperson Table is as follows

Thanks

EmployeeID EmployeeName EmployeeAddress EmployeeCity EmployeeState EmployeeZip EmployeeBirthDate EmployeeDateHired EmployeeSupervisor Height Weight 123-44-345 Phil Morris 2134 Hilltop Rd Knoxville TN NULL 1949-05-01 1975-12-06 454-56-768 72 172 332445667 Lawrence Haley 5970 Spring Crest Rd Nashville TN 54545 1963-08-15 1999-05-01 454-56-768 66 165 454-56-768 Robert Lewis 17834 Deerfield Ln Knoxville TN 55555 1964-08-25 1998-01-01 123-44-345 74 160 555955585 Mary Smith 75 01e Lane Clearwater FL 33879 1969-06-05 2000-08-15 332445667 71 155 Laura Laura Ellenburg 5342 Picklied Trout Lane Nashville TN 38010 NULL 2000-02-22 454-56-768 76 268

Explanation / Answer

1.

SELECT EmployeeName, EmployeeState FROM Salesperson WHERE EmployeeState IN (SELECT EmployeeState FROM Salesperson GROUP BY EmployeeState HAVING COUNT(EmployeeState)) ORDER BY EmployeeState;

2.

SELECT * FROM Salesperson WHERE EmployeeBirthDate = (SELECT min(EmployeeBirthDate) FROM Salesperson);

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