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
Schema for Multi-Center Trials
00:00
5 left

Schema for Multi-Center Trials

HardSQL · PostgreSQL

Problem

How would you design a database schema to support a multi-center clinical trial tracking system?

Create a normalized schema for trials, centers, trial assignments, subjects, and visits, then write a query for trial 1 covering January through March 2025.

Output

  1. One row per assigned center and month, excluding no rows for centers without activity.
  2. Columns: center_name, country, month_start, new_enrollments, total_visits, completed_visits, completion_rate_pct, prior_month_enrollments, and monthly_completed_visit_rank.
  3. Sort by center_name, then month_start ascending.

Schema

trials
ColumnTypeDescription
trial_idPKINTTrial identifier
protocol_codeVARCHAR(20)Clinical protocol code
trial_nameVARCHAR(100)Trial name
phaseVARCHAR(40)Clinical trial phase
centers
ColumnTypeDescription
center_idPKINTCenter identifier
center_nameVARCHAR(100)Research center name
countryVARCHAR(60)Center country
trial_centers
ColumnTypeDescription
trial_idPKINTReferenced trial
center_idPKINTReferenced center
activation_dateDATEDate the center joined the trial
subjects
ColumnTypeDescription
subject_idPKINTSubject identifier
trial_idINTReferenced trial
center_idINTRecruiting center
subject_codeVARCHAR(30)De-identified subject code
enrollment_dateDATESubject enrollment date
visits
ColumnTypeDescription
visit_idPKINTVisit identifier
subject_idINTReferenced subject
visit_dateDATEScheduled or completed visit date
visit_statusVARCHAR(20)Visit status
Tablestrialscenterstrial_centerssubjectsvisits
Interviewer

Your question is Schema for Multi-Center Trials. Start with the requirements and the five 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.