Lawfare Academy

DATA201 · EXTENDED TEACHING

Data Management and SQL for Business

Original instruction, explicit assumptions, worked decisions and progressively harder practice.

Course introduction → · All extended teaching → · Company simulation →

These clinics deepen selected course lessons. The original syllabus and assigned free readings remain part of the learning sequence. All exercises and capstones are voluntary; no grade or submission is required.

data201-unit-1

Data models and business meaning

A relational model represents entities, events and business meaning. Orders, lines and payments have different grains. Structure cannot recover history that was never recorded, so define transaction values and changes explicitly.

Work from these facts

One customer has many orders and an order many products.

Build the answer — optional

Work through the decision using the stated facts. Show the calculation or reasoning, distinguish assumptions from evidence, and compare a feasible alternative.

Compare the worked answer

Use customer, order, product and order-line tables with stable keys, and payments separately when settlement can be multiple. Retain transaction price rather than reconstructing historical sales from today’s product price.

Change an assumption

If products are renamed, stable IDs preserve relationships; names alone are unreliable keys.

Read within the course lesson →

data201-unit-2

Keys and relational integrity

Keys and referential integrity prevent some duplicates and orphan records, not fictitious events or incorrect facts. Stable identifiers should represent the intended entity, with a controlled correction process.

Work from these facts

An import uses customer name as a unique key, merging two people with the same name.

Build the answer — optional

Work through the decision using the stated facts. Show the calculation or reasoning, distinguish assumptions from evidence, and compare a feasible alternative.

Compare the worked answer

Assign stable IDs and reconcile affected records using evidence. Preserve a mapping and audit trail instead of overwriting history blindly. Decide whether the question concerns people, accounts or locations before deduplication.

Change an assumption

The same person can legitimately hold multiple accounts; removing them as duplicates may erase valid business distinctions.

Read within the course lesson →

data201-unit-3

Filtering and aggregation

SQL filters and grouping determine which records and grain a summary represents. NULL is not automatically zero; typical aggregates ignore it. Check a known small dataset before trusting a large report.

Work from these facts

Invoice values are $100, $200 and NULL, where the third is unknown.

Build the answer — optional

Work through the decision using the stated facts. Show the calculation or reasoning, distinguish assumptions from evidence, and compare a feasible alternative.

Compare the worked answer

Typical SUM is $300 and AVG $150 over two known values. A zero-filled average of $100 changes the meaning and conceals missingness. Report completeness and define the population alongside the estimate.

Change an assumption

If the third amount is verified to be zero, recording zero is appropriate; the evidence, not convenience, resolves the distinction.

Read within the course lesson →

data201-unit-4

Joins and duplicate counting

Joins can multiply records when both sides have multiple matches. Aggregate children to the required parent grain before combining totals and reconcile counts and sums afterward.

Work from these facts

An order has three lines and two payments, joined directly to each other.

Build the answer — optional

Work through the decision using the stated facts. Show the calculation or reasoning, distinguish assumptions from evidence, and compare a feasible alternative.

Compare the worked answer

There are six matched rows. Summing repeated payment or header amounts overcounts. Aggregate line and payment totals separately by order, then join summaries. DISTINCT on value is unsafe because genuine equal payments can occur.

Change an assumption

A return needs its own linked event or correct net treatment, not deletion of inconvenient history.

Read within the course lesson →

data201-unit-5

Transactions and controls

A transaction groups changes that should succeed or fail together. Atomicity is not authorization and does not prove physical events occurred. Distributed workflows also need durable status, retry and reconciliation beyond one local commit.

Work from these facts

Stock leaves warehouse A in the database but the increase at B fails.

Build the answer — optional

Work through the decision using the stated facts. Show the calculation or reasoning, distinguish assumptions from evidence, and compare a feasible alternative.

Compare the worked answer

Use a suitable atomic transfer or controlled distributed process, stable transfer ID and reconciliation. Both sides should commit or a visible exception should remain. Verify physical movement independently.

Change an assumption

If transport is still underway, model an in-transit state rather than pretending instantaneous receipt is the only consistent design.

Read within the course lesson →

data201-unit-6

Business queries and validation

Business query validation tests meaning and boundaries, not merely syntax. Include missing values, returns, duplicates and period edges and reconcile to authoritative records. Event dates answer different questions.

Work from these facts

A sales report filters payment dates while management requests earned revenue.

Build the answer — optional

Work through the decision using the stated facts. Show the calculation or reasoning, distinguish assumptions from evidence, and compare a feasible alternative.

Compare the worked answer

The query measures collections, not necessarily performance. Identify the earning event and applicable reporting basis, test month-end crossings and reconcile receivables. Preserve a correctly labeled collection report if useful.

Change an assumption

A syntactically perfect query on the wrong business event can create precise but misleading decisions.

Read within the course lesson →

Supporting conceptual readings

Open the course’s Readings & practice stage for the complete chapter assignments. The following publisher links support the subject; the fictional clinic text and cases are original Academy instruction.

AI-assisted original educational material. Calculations and integration were checked; independent business-faculty review remains pending. Cases omit real-world details explicitly or require further evidence.