vacancy_ads has one row per job listing (company_id, title, job_id). A company has a duplicate listing when it posted two or more listings with exactly the same title. Count how many distinct companies have at least one duplicate listing (a company with several duplicated titles is counted once). Output a single column: duplicate_companies.
| Column | Type |
|---|---|
| company_id | INTEGER |
| title | TEXT |
| job_id | INTEGER |
| company_id | title | job_id |
|---|---|---|
| 1 | Data Analyst | 10 |
| 1 | Data Analyst | 11 |
| 1 | Engineer | 12 |
| 2 | Data Analyst | 13 |
| 2 | Data Analyst | 14 |
| 3 | Designer | 15 |
| duplicate_companies |
|---|
| 2 |
Solve it in the live editor on this page — run on sample data, then submit against hidden tests.
‹ High-Volume Collaboration Members · Cities With Settled Orders ›
{{ totalCount }} questions in the style asked at Amazon, Microsoft, Google, Meta, Flipkart and more — {{ hardPct }}% Hard. Write SQL in a real database engine in your browser, run it on sample data, then evaluate against hidden tests.
Company tags show where this type of question is commonly reported in interviews. Questions, data and solutions are written by TechTown.
{{ cur.statement }}
No submissions yet. Press Evaluate to submit your query.
{{ solutionSql }}
{{ out.error }}
You have solved your 3 free questions — nice work! Log in (free) to unlock all 150 questions, keep your streak and appear on the leaderboard.