Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Trending in AI
Hot
Agentic AI EngineerForward-Deployed EngineerGenAI EngineerAI Architect
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
ExperiencesCoaching
New
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
Start free
Database Normalization from 1NF to BCNF
00:00
5 left

Database Normalization from 1NF to BCNF

HardSQL · PostgreSQL

Problem

Create a table and normalize it step by step from 1NF to BCNF.

Asked in the Technical + HR stage. Use PostgreSQL DDL and DML to show the original atomic relation and its normalized decomposition. Preserve the data and document the functional dependencies that justify each decomposition.

Output

  1. The original 1NF table and the final BCNF tables.
  2. A verification result with one row per claim and service code, including claim, member, provider, and service attributes.
  3. Verification rows ordered by claim_id, then service_code.

Schema

claims_1nf
ColumnTypeDescription
claim_idPKINTClaim identifier, part of the composite key
service_dateDATEDate of service
member_idVARCHAR(10)Member identifier
member_nameVARCHAR(100)Member name
provider_idVARCHAR(10)Provider identifier
provider_nameVARCHAR(100)Provider name
provider_specialtyVARCHAR(100)Provider specialty
service_codePKVARCHAR(10)Service identifier, part of the composite key
service_descriptionVARCHAR(200)Service description
unitsINTUnits billed
unit_chargeNUMERIC(10,2)Charge per unit
referral_noteVARCHAR(200)Optional referral note
members
ColumnTypeDescription
member_idPKVARCHAR(10)Member identifier
member_nameVARCHAR(100)Member name
providers
ColumnTypeDescription
provider_idPKVARCHAR(10)Provider identifier
provider_nameVARCHAR(100)Provider name
provider_specialtyVARCHAR(100)Provider specialty
services
ColumnTypeDescription
service_codePKVARCHAR(10)Service identifier
service_descriptionVARCHAR(200)Service description
claims
ColumnTypeDescription
claim_idPKINTClaim identifier
service_dateDATEDate of service
member_idVARCHAR(10)Referenced member
provider_idVARCHAR(10)Referenced provider
claim_services
ColumnTypeDescription
claim_idPKINTClaim identifier, part of the composite key
service_codePKVARCHAR(10)Service identifier, part of the composite key
unitsINTUnits billed
unit_chargeNUMERIC(10,2)Charge per unit
Tablesclaims_1nfmembersprovidersservicesclaimsclaim_services
Interviewer

Whenever you're ready, walk me through your approach or go straight to the code. The requirements and the six tables are in the Question tab.

Sign up free to run or submit. Log in
CodePostgreSQL
Sign up free to run your code. Your draft is saved.Run with a free accountLog inLn 1
Run your query to see results here.