#124 Posts by Users with Many Followers

Companies:
Sberbank T-Bank
Themes:
SQLJoinsPractice

Select all posts published by users who have more than 500 followers:

CREATE TABLE profile
(
    id            BIGSERIAL PRIMARY KEY,
    nickname      VARCHAR,
    registered_at TIMESTAMP
);

CREATE TABLE post
(
    id          BIGSERIAL PRIMARY KEY,
    owner_id    BIGINT REFERENCES profile (id),
    body        TEXT,
    inserted_at TIMESTAMP,
    likes_count INT -- number of likes
);

CREATE TABLE subscription_count
(
    profile_id       BIGINT REFERENCES profile (id) UNIQUE,
    followers_count  INT, -- number of followers
    following_count  INT  -- number of followed profiles
);

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in