SQL · Meta · Medium
Consider a PostgreSQL feed database that records users, friendships, posts, feed impressions, and interactions. All timestamps are UTC, and friendships are static across the analysis window. Write SQL for each task below. Tables: users(user_id INT, join_date DATE) friendships(user_id INT, friend_id INT) — undirected; if two users are friends, both directed rows are present. posts(post_id INT, author_id INT, created_at TIMESTAMP) feed_impressions(imp_id INT, user_id INT,…
Checking your access…