#193 SQL Queries for Profiles, Followers, and Articles
The following tables are given:
CREATE TABLE profile
(
id BIGSERIAL PRIMARY KEY,
nickname VARCHAR,
registered_at TIMESTAMP
);
CREATE TABLE subscription_count
(
profile_id BIGINT REFERENCES profile (id) UNIQUE,
followers_count INT, -- number of followers
following_count INT -- number of subscriptions
);
CREATE TABLE article
(
id BIGSERIAL PRIMARY KEY,
owner_id BIGINT REFERENCES profile (id),
article TEXT, -- article
created_in TIMESTAMP,
likes_count INT -- number of likes
);
It is necessary to:
- Select the
nicknamevalues of profiles that have more than1000followers. - Select the
idvalues of profiles that have more than10articles.
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor