Skip to main content

Audit Queries

Use this page as the audit and controls query library. The groups below organize reusable SQL by control question: process completeness, manufacturing controls, workforce and attendance, master data, financial timing, planning support, pricing governance, and design-service billing support.

Audit Query Groups

Core process completeness and anomaly triage

Use these queries to start from document-chain completeness, cutoff timing, anomaly triage, and customer-service exception patterns.

Open a query when you want to inspect the SQL, copy it into SQLite, or trace the source-table logic.

O2C Document Chain Completeness
P2P Document Chain Completeness
Cutoff and Timing Analysis
Potential Anomaly Review
Backorder and Return Review

Manufacturing and work-order controls

Use these queries to test BOM, routing, scheduling, capacity, operation timing, labor support, and released-work-order exception seeds.

Open a query when you want to inspect the SQL, copy it into SQLite, or trace the source-table logic.

Missing BOM or Supply Mode Conflict
Over Issue and Open WIP Review
Work Order Close Timing Review
Missing Routing or Operation Link Review
Operation Sequence and Final Completion Review
Schedule on Nonworking Day Review
Over Capacity Day Review
Completion Before Scheduled Operation End
Labor Outside Scheduled Operation Window Review
Released Work Orders Due without Actual Start Review
Released Work Orders Due without Actual Start Summary

Payroll, workforce, attendance, and time controls

Use these queries to review payroll support, employee lifecycle activity, schedule and punch integrity, absence conflicts, overtime, and roster control.

Open a query when you want to inspect the SQL, copy it into SQLite, or trace the source-table logic.

Payroll Control Review
Labor Time After Close and Paid without Time
Time Clock Exceptions by Employee Supervisor Work Center
Paid without Clock and Clock without Pay Review
Time Clock Payroll Labor Bridge Review
Terminated Employee Activity Review
Terminated Employee Activity Rollup by Process Area
Scheduled without Punch and Punch without Schedule Review
Overtime without Approval Review
Absence with Worked Time Review
Overlapping or Incomplete Punch Review
Roster After Termination Review

Master data, approvals, role design, and authority limits

Use these queries to test approval roles, executive uniqueness, employee assignments, item completeness, lifecycle status, and authority limits.

Open a query when you want to inspect the SQL, copy it into SQLite, or trace the source-table logic.

Approval and SOD Review
Approval Role Review by Org Position
Executive Role Uniqueness and Control Assignment Review
Item Master Completeness Review
Discontinued or Prelaunch Item Activity Review
Approval Authority Review by Expected Role Family
Current State Employee Assignment Review
Approval Authority Limit Review
Item Status Alignment Review

Accrual, cash, duplicate-reference, and financial timing review

Use these queries to investigate duplicate payment references, accrued-service settlement, customer deposits, cash application, and supplier-reference exceptions.

Open a query when you want to inspect the SQL, copy it into SQLite, or trace the source-table logic.

Duplicate Payment Reference Review
Over Under Accrual Review
Accrued Service Settlement Exception Review
Customer Deposits and Unapplied Cash Exception Review
Duplicate AP Reference Detail Review

Planning-support, pricing-governance, and design-service controls

Use these queries to test planning support, inventory policy, replenishment conversion, commercial pricing governance, and design-service billing support.

Open a query when you want to inspect the SQL, copy it into SQLite, or trace the source-table logic.

Forecast Approval and Override Review
Inactive or Stale Inventory Policy Review
Requisitions and Work Orders without Planning Support
Recommendation Converted After Need by Date Review
Discontinued or Prelaunch Planning Activity Review
Sales Below Floor without Approval
Expired or Overlapping Price List Review
Promotion Scope and Date Mismatch Review
Customer Specific Price List Bypass Review
Override Approval Completeness Review
Design Service Approved vs Billed Hours Review

Main Table Families

TopicMain tables
O2C and P2P completenessO2C and P2P header and line tables plus CashReceiptApplication
Approvals and segregation of dutiesPurchaseRequisition, PurchaseOrder, PurchaseInvoice, JournalEntry, CreditMemo, CustomerRefund, PayrollRegister, Employee
Manufacturing controlsItem, BillOfMaterial, Routing, WorkCenter, WorkOrder, WorkOrderOperation, WorkOrderOperationSchedule, MaterialIssueLine, ProductionCompletionLine, WorkOrderClose
Payroll and time controlsShiftDefinition, EmployeeShiftAssignment, EmployeeShiftRoster, EmployeeAbsence, OvertimeApproval, TimeClockPunch, TimeClockEntry, AttendanceException, LaborTimeEntry, PayrollRegister, PayrollRegisterLine, PayrollPayment, PayrollLiabilityRemittance, Employee
Master-data controlsEmployee, Item, PriceList, PriceListLine, PromotionProgram, PriceOverrideApproval, plus operational tables that reuse those masters
Cross-process control reviewCombine query output with source-table tracing across the affected process tables

Baseline Control Queries

Use these first when you want control logic without relying on planted anomalies:

  • O2C and P2P completeness
  • approval-role review by organization position
  • executive-role uniqueness and control-assignment review
  • approval-authority review by expected role family

Exception-Oriented Queries

Use these when you want students to review the exception patterns present in the published dataset:

  • duplicate payment or AP reference review
  • payroll control review
  • routing and operation-link review
  • released work orders due without actual start review
  • released work orders due without actual start summary
  • time-clock and labor exception review
  • roster, punch, absence, and overtime-approval review
  • terminated-employee activity review
  • item-master completeness review
  • discontinued or pre-launch item activity review
  • current-state employee assignment review
  • approval authority-limit review
  • item status alignment review
  • forecast approval and override review
  • inactive or stale inventory policy review
  • requisitions and work orders without planning support
  • recommendation converted after need-by date review
  • discontinued or pre-launch planning activity review
  • sales below floor without approval
  • expired or overlapping price-list review
  • promotion scope and date mismatch review
  • customer-specific price-list bypass review
  • override approval completeness review

Interpretation Notes

  • Exception-oriented queries are designed to return reviewable control patterns from the published dataset.
  • The GL remains balanced even when audit queries identify exceptions.
  • Employee-master review should distinguish current-state IsActive from historical validity driven by HireDate and TerminationDate.
  • Item-master review should distinguish current-state lifecycle and launch-date logic from operational usage timing.
  • Pricing-control review should distinguish price-list master-data failures from transaction-level override and promotion-use failures.
  • Source-table tracing should remain the final step in explaining each exception pattern.

Anomaly Coverage Queries

Click Show SQL to open a query, review the logic, and copy it into SQLite or a compatible SQL tool.

AP payment review
broad control screening
payroll settlement review
labor support review
manufacturing linkage review
operation sequence review
capacity-calendar review
capacity review
schedule-completion review
attendance exception review
labor timing review
payroll-time reconciliation
workforce bridge review
AP duplicate-reference review
employment validity review
executive-role review
item-master completeness review
item-lifecycle review
approval-role review
employment rollup review
assignment ownership review
authority-limit review
item-status alignment review
roster-punch review
overtime approval review
absence-time conflict review
punch-sequence review
post-termination roster review
forecast-governance review
inventory-policy review
planning-support review
recommendation-timing review
planning-lifecycle review
price-floor review
price-list validity review
promotion-scope review
customer-price review
override-approval review