Exam Certified Data Analyst Associate All QuestionsBrowse all questions from this exam
Question 22

A business analyst has been asked to create a data entity/object called sales_by_employee. It should always stay up-to-date when new data are added to the sales table. The new entity should have the columns sales_person, which will be the name of the employee from the employees table, and sales, which will be all sales for that particular sales person. Both the sales table and the employees table have an employee_id column that is used to identify the sales person.

Which of the following code blocks will accomplish this task?

    Correct Answer: A

    This solution involves joining the employees table with the sales table on their common employee_id column. In SQL, the columns sales_person (which will be the name of the employee from the employees table) and sales (which is the sum of all sales for that particular sales person) can be successfully selected and aggregated using a GROUP BY clause on the employee_id field from the employees table.

Discussion
MrWood47Option: D

Answer provided is correct!

barmandOption: D

answer D is correct as we are calculating % rank