Duplicate Job Listings
Beginner Mode
Objective
Write a SQL query to count how many companies posted duplicate job listings with the same title and description.
Table Schema:
- job_listings
| Column | Type | Description |
|---|---|---|
| job_id | INTEGER | Unique identifier for each job listing |
| company_id | INTEGER | ID of the company that posted the job |
| title | VARCHAR | Title of the job listing |
| description | TEXT | Description of the job listing |
Task Requirements:
- Identify companies that posted duplicate job listings (same title and description)
- Count how many companies have posted such duplicates
- Return only the count of companies with duplicates
Output columns: duplicate_companies
Examples
Example 1:
Output:
Input:
| job_listings | |||
|---|---|---|---|
| company_id | description | job_id | title |
| 101 | Develop applications | 1 | Software Engineer |
| 101 | Develop applications | 2 | Software Engineer |
| 102 | Analyze data | 3 | Data Analyst |
| 102 | Analyze data | 4 | Data Analyst |
| 103 | Manage products | 5 | Product Manager |
| duplicate_companies |
|---|
| 2 |
Code Environment
Sign in or try as guest to run your code.
Track
| Question | Difficulty | Company | Access |
|---|
Need more practice in this area? Explore more questions →
LinkedIn