Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
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 feedbackSuccess 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 Join for Managers
00:00
5 left

SQL Join for Managers

EasySQL · PostgreSQL

Problem

Context

Fidelity Investments maintains employee details separately from current position assignments. HR reporting needs the complete employee records for people currently assigned to the Manager position.

Task

Write a PostgreSQL query that returns all columns from employee_info for employees whose matching record in employee_position has position_title = 'Manager'.

Requirements

  1. Join the tables using emp_id.
  2. Return every column from employee_info, excluding position table columns.
  3. Include only employees whose position is exactly Manager.
  4. Order the results by emp_id ascending for deterministic output.

Schema

employee_info
ColumnTypeDescription
emp_idPKINTEGEREmployee identifier
full_nameVARCHAR(100)Employee's full name
departmentVARCHAR(80)Fidelity business department
emailVARCHAR(150)Corporate email address
hire_dateDATEEmployee hire date
employee_position
ColumnTypeDescription
emp_idPKINTEGEREmployee identifier from the position feed
position_titleVARCHAR(80)Current position assignment
effective_dateDATEDate the position became effective
Tablesemployee_infoemployee_position
Interviewer

Your question is SQL Join for Managers. Start with the requirements and the two tables 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.