This is a prod sense question: In a Batch system, How to use metrics analysis success…
- User
This is a prod sense question: In a Batch system, How to use metrics analysis success for Dropbox?
- Assistant
- User
I means, how to use metrics to analyze Dropbox not "Interacts with dropbox"
- Assistant
- User
give a more detailed information of Analysis, As interviewer ask this question.
- Assistant
- User
I need you extend "Metrics Analysis" for DROPBOX based on what you mentioned.
- Assistant
- User
I need you extend your answer with some possible example one by one
- Assistant
- User
based on metrics that you mentioned in previous question, design a database schema (dimensional model) for Dropbox: It should including : upload, sharing, ownership transfer
- Assistant
- User
Do you including all metrics that you mentioned in previous question? if not, extend your schema design and give a detail information how to get the metrics data.
- Assistant
- User
SQL question - based on you schema design Find how many users only upload photo?
- Assistant
To answer this query using SQL, we need to make a couple of assumptions due to the nature of the schema provided:
- Uploaded files (photos in this case) are recorded in the
fact_file_activitiestable with anactivity_type_idcorresponding to 'upload'. - The table contains the indicating whether the file is a photo; for simplicity, let's assume that photos have a like 'jpg', 'png', 'gif', etc.
- Uploaded files (photos in this case) are recorded in the
- User
SQL question - how many files have multiple owners;
- Assistant
To find out how many files have had multiple owners, we need to have access to the file activity data that records ownership transfers. Assuming ownership transfer is a type of activity captured in the
fact_file_activitiestable and that we have anactivity_type_idthat denotes ownership transfer, you can write a SQL query to count files with more than one owner.SELECT COUNT(file_id) AS files_with_multiple_owners FROM ( SELECT file_id FROM fact_file_activities WHERE activity_type_id = (SELECT activity_type_id FROM dim_activity_type WHERE activity_description = 'Ownership Transfer') GROUP BY file_id HAVING COUNT(DISTINCT previous_owner_user_id) > 1 -- Assuming previous_owner_user_id is recorded for transfer ) AS subquery;