Reconcile one business measure across two order systems

A hands-on CBAP lab. You produce the real artefact and 9 automated checks verify it behaves the way the exam expects.

Try this labAll CBAP practice

Certification
CBAP
Format
SQL query
Difficulty
hard
Estimated time
35 min
Automated checks
9

The brief

Repair data-definition.sql. Return exactly booking_id, system, canonical_state, net_merch_cents, one row per distinct registry record. booking_id identifies a registry record; system/external_id together identify its authoritative source. External IDs may coincide across A and B. All imported copies that match in every field collapse; distinct variants with one header ID or one B line ID remain ambiguous, never arbitrarily selected. For A, CLOSED means FULFILLED, OPEN means PENDING and VOID means CANCELLED. For B, DONE means FULFILLED, PENDING means PENDING and CANCELLED means CANCELLED. Unknown codes mean UNKNOWN_STATE. A fulfilled A header's net merchandise cents = gross_cents - tax_cents - shipping_cents - service_cents. The gross field includes all those components. A fulfilled B order's net merchandise cents = sum(quantity * unit_dollars * 100) over distinct PRODUCT lines only. SERVICE lines are excluded; negative quantities are signed returns, never absolute purchases. Do not multiply order headers by line joins or subtract hypothetical B header taxes again. Missing authoritative headers mean SOURCE_MISSING; multiple distinct header variants mean AMBIGUOUS_HEADER, before interpreting status. An otherwise fulfilled B order with no lines means LINES_MISSING; conflicting variants of a B line ID mean AMBIGUOUS_LINES, before summing. A fulfilled service-only order genuinely has zero merchandise. Pending, unknown and unresolved records need NULL net merchandise; only CANCELLED has known zero independent of stored amounts. Registry systems other than A/B mean UNKNOWN_SOURCE and NULL. Preserve every registry record, including zero, negative and unresolved amounts. Choose pre-aggregated source views or correlated per-record reconciliation; validate unfamiliar IDs and repair one remaining definition without Reset.

What the checks verify

Your work is graded on 9 independent properties, not on matching one reference answer.

  • A bounded source-definition query executes.
  • Source identity, canonical disposition and monetary meaning are explicit.
  • Every distinct registry record has exactly one authoritative-source result.
  • System A gross components are excluded from net merchandise.
  • Whole-dollar unit prices convert once to integer cents at line grain.
  • Product returns retain their sign and service amounts stay outside merchandise.
  • Known cancellation, pending completion and unknown codes remain distinct.
  • Missing and conflicting authoritative facts remain explicit unresolved states.
  • Definitions apply to unfamiliar IDs, negative headers and zero-quantity lines.

Where this sits in the CBAP blueprint

Domain
Requirements Analysis and Design Definition
Objective
Specify and Model Requirements
Skill
Coherent Analysis Representations

Part of CBAP preparation

Labs are written by ExamNova to teach the decisions the exam tests. They are not reproductions of vendor lab content.