Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Count Archive Center Documents by Status

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

Your question is Count Archive Center Documents by Status. Start with the requirements and the one table 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

You are given a table from an OpenText Archive Center reporting extract. Write a basic SQL query to return the number of documents for each document_status, considering only rows where retention_years is greater than 0. Sort the result by the document count in descending order.

Schema

archive_documents
ColumnTypeDescription
document_idPKINTUnique document identifier
repository_nameVARCHAR(100)Archive repository name
document_statusVARCHAR(30)Current document lifecycle status
retention_yearsINTRetention period in years
archived_dateDATEDate the document was archived
Tablesarchive_documents
Your solutionPostgreSQL
You need to log in / sign up to run or submit.
Run a query to see results