课程: Coding Exercises: SQL Data Science

今天就学习课程吧!

今天就开通帐号,24,700 门业界名师课程任您挑!

Partitioning dates with the DATE_PART function

Partitioning dates with the DATE_PART function - SQL教程

课程: Coding Exercises: SQL Data Science

Partitioning dates with the DATE_PART function

(fun upbeat music) - [Instructor] Janan Darwish is the new social media engagement manager who has been appointed to build the strategy to enhance engagement via social media posts. He has asked you to send him a report on the average engagement for every day of a week. Now, he wants to find out the days when their posts witness more engagement. (fun music) Now, the challenge is to calculate engagement for every day of the week where engagement is defined as number of engaged_fans divided by the reach of that post. And since there is only date in the table PostInsights, you will have to extract day of the week from the date and then group it for every day of a week and sort them in the descending order. So some important parts of this query will be, you'll have to use PostInsights table to get engaged_fans and reach of every post, then engagement will be calculated as engaged_fans divided by the reach multiplied by 100,…

内容