Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

PubMatic Reseller vs Direct Counts

EasySQL · PostgreSQL00:00
Practice interviewer
In session
5 left
00:00

Your question is PubMatic Reseller vs Direct Counts. Start with the requirements and the two tables on the right.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.

Problem

PubMatic QA engineers need to validate seller entries discovered on a publisher web page. Write a PostgreSQL query that counts the exact PubMatic direct and PubMatic reseller entries for the page with domain dailynews.example.

Requirements

  1. Join web_pages to page_entries using page_id.
  2. Return one row containing the page domain, the count of exact PubMatic direct entries, and the count of exact PubMatic reseller entries.
  3. Preserve the page in the result even if it has no matching entries, and do not count NULL or other entry types.

Schema

web_pages
ColumnTypeDescription
page_idPKINTPrimary key for the web page
domainVARCHAR(255)Web page domain
page_entries
ColumnTypeDescription
entry_idPKINTPrimary key for the discovered entry
page_idINTReferenced web page identifier
entry_typeVARCHAR(50)Classified seller entry type
Tablesweb_pagespage_entries
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results