Skip to main content

Post Success By Interface

Medium

You are given the following tables:

post table:

post_idpost_dateuser_idinterfaceis_successful_post
integertimestampintegerstringboolean

post_user table

user_iduser_typeage
integerstringinteger

Write an SQL query that calculates the success rate (in percentage) of posts originating from various iPhone models.

Your output should have the following columns: interface, post_success (no. of successful posts), post_attempt (no. of posts), post_success_rate (Round to 2 decimal place). Order by descending success rate.