Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
SQL Select with Multiple Conditions
00:00
5 left

SQL Select with Multiple Conditions

MediumSQL · PostgreSQL

Problem

Write a SQL SELECT query against the given table with three to four conditions applied at once - read the prompt carefully, several conditions are easy to miss. Asked in the Individual technical case (SQL track) stage. Candidate chose SQL over Excel for the individual technical case and described this as a basic SELECT with three to four conditions.

Using the supplied table, return documents meeting all four conditions: approved status, SOP document type, an effective date from January 1 through June 30, 2025, and a non-Finance owner department.

Output

  1. Return document_id, document_title, owner_department, and effective_date.
  2. Include one row per qualifying document and sort by effective_date ascending, then document_id ascending.

Schema

vault_documents
ColumnTypeDescription
document_idPKINTUnique document identifier
document_titleVARCHAR(150)Document title
statusVARCHAR(30)Current document status
document_typeVARCHAR(50)Document classification
effective_dateDATEDate the document becomes effective
owner_departmentVARCHAR(80)Department responsible for the document
Tablesvault_documents
Interviewer

Your question is SQL Select with Multiple Conditions. Start with the requirements and the one table in the Question tab.

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.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.