MiniCTRMSearch

MiniCTRM - Tutorial: The deal model in SQL - Power

→ to begin · N for the speaker notes

On a phone: Next or a swipe left to begin, Notes for the words.

What you'll learn

  • The map – The three tables on the Data Model diagram, their grain, and the SQL Query screen.
  • The deal table – One row per trade: its schema, your deal's row, the ticket beside it, and dates stored as text.
  • Foreign keys – Ids, not names: joining to counterparty and the rest, and the deal a JOIN loses.
  • The deal_side table – One row per leg: the legs, what the floating leg floats on, and the key to use.
  • The payment profile – One row per leg per period: the cash flows, their signs, the currency, and net cash by date.
  • The tables around them – Type headers, physical delivery points, fees and derived tables.
  • The mistakes – A sum counted once per joined row, and the checklist before you trust a query.

Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.

Welcome

The deal model in SQL

1 / 31
The deal model in SQL
Welcome

You read; the application writes

2 / 31
You read; the application writes
The map

Three tables deep

3 / 31
Three tables deep
The map

One, many, many more

4 / 31
One, many, many more
The map

The SQL Query screen

5 / 31
The SQL Query screen
The deal table

What a deal row holds

6 / 31
What a deal row holds
The deal table

Find your deal

7 / 31
Find your deal
The deal table

Read the row

8 / 31
Read the row
The deal table

The same row on the ticket

9 / 31
The same row on the ticket
The deal table

Dates are text

10 / 31
Dates are text
Foreign keys

An id, not a name

11 / 31
An id, not a name
Foreign keys

Join to get the name

12 / 31
Join to get the name
Foreign keys

Every name on the deal

13 / 31
Every name on the deal
Foreign keys

The deal that vanished

14 / 31
The deal that vanished
The deal_side table

What a leg holds

15 / 31
What a leg holds
The deal_side table

Your deal's legs

16 / 31
Your deal's legs
The deal_side table

Read the legs

17 / 31
Read the legs
The deal_side table

The legs on the ticket

18 / 31
The legs on the ticket
The deal_side table

What the floating leg floats on

19 / 31
What the floating leg floats on
The payment profile

Your deal's cash flows

20 / 31
Your deal's cash flows
The payment profile

Read a row

21 / 31
Read a row
The payment profile

The same rows on the ticket

22 / 31
The same rows on the ticket
The payment profile

Which leg is which

23 / 31
Which leg is which
The payment profile

A row's currency

24 / 31
A row's currency
The payment profile

Net cash per payment date

25 / 31
Net cash per payment date
The tables around them

Columns only some deals have

26 / 31
Columns only some deals have
The tables around them

Where physical legs deliver

27 / 31
Where physical legs deliver
The tables around them

Fees and derived tables

28 / 31
Fees and derived tables
The mistakes

Counted once per row

29 / 31
Counted once per row
The mistakes

Before you trust a query

30 / 31
Before you trust a query
What next

Where to go from here

31 / 31
Where to go from here

You have finished lesson 401, The deal model in SQL.

Where next?

← → move · N notes · Home / End