Answered by anonymousUser

SELECT
	n_peop,
    ROUND(AVG(bill),2) AS avg_bill,
    ROUND(AVG(tip), 2) AS avg_tip,
    count(1) AS num_samples,
    ROUND(ROUND(AVG(tip),2)/ROUND(AVG(bill), 2), 4)*100 AS tip_pct
FROM tips_data 
GROUP BY n_peop
ORDER BY tip_pct DESC;