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
Calculating Phishing Click-Through Rate
00:00
5 left

Calculating Phishing Click-Through Rate

MediumSQL · PostgreSQL

Problem

Write a query to find the click-through rate of simulated phishing campaigns at KnowBe4, grouped by industry and organization size.

Use all simulated phishing campaigns and count only delivered messages in the denominator. A click-through rate is the percentage of delivered messages with a recorded click.

Output

  1. One row per industry and organization size combination represented by delivered or attempted messages.
  2. Columns: industry, organization_size, clicked_messages, delivered_messages, and click_through_rate_pct.
  3. Return the rate as a percentage rounded to two decimal places, including zero or null when no messages were delivered.
  4. Order by industry, then organization_size.

Schema

campaigns
ColumnTypeDescription
campaign_idPKINTUnique simulated campaign identifier
organization_idINTOrganization that launched the campaign
campaign_nameVARCHAR(150)Campaign display name
campaign_typeVARCHAR(50)Campaign category
organizations
ColumnTypeDescription
organization_idPKINTUnique organization identifier
organization_nameVARCHAR(150)Organization name
industryVARCHAR(100)Organization industry
organization_sizeVARCHAR(30)Organization size segment
campaign_recipients
ColumnTypeDescription
recipient_event_idPKINTUnique recipient campaign record
campaign_idINTCampaign associated with the recipient
recipient_emailVARCHAR(200)Recipient email address
delivered_atTIMESTAMPTimestamp when the simulated message was delivered
clicked_atTIMESTAMPTimestamp when the recipient clicked the simulated phishing link
Tablescampaignsorganizationscampaign_recipients
Interviewer

Your question is Calculating Phishing Click-Through Rate. Start with the requirements and the three 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.