QuestionQ75

VerifiedData Modeling with Databricks SQL

A business analyst needs to create a data entity/object named sales_by_employee. It must always remain current when new data are added to the sales table. The new entity must contain the following columns: sales_person, which is the employee name from the employees table, and sales, which contains all sales for that particular sales person. Both the sales and employees tables contain an employee_id column used to identify the sales person.

Which of the following code blocks will accomplish this task?

Explanation

A standard view is defined by a SELECT statement and reads from its underlying tables when queried, so it reflects newly added sales rows. CREATE OR REPLACE VIEW sales_by_employee AS followed by a SELECT that joins sales and employees on employee_id correctly creates the required current result and aliases the employee name as sales_person.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!