# Free sample: Ops SQL Pattern Catalog

_Teaser only — 5 of 141 sanitized MySQL patterns._

Real-world commerce/ERP **reporting SQL**, parameterized (`:company_id`, `:date_from`, `:date_to`).
No tenant names. Review joins before production.

## Sample entries

### sql_0001 — Invoice Credits by Customer
- **Category:** invoicing
- **Tables:** contacts, credits, credits_data, invoices, invoices_data
- **Description:** Invoice/credit reconciliation query for "Invoice Credits by Customer". Primary tables: contacts, credits, credits_data, invoices, invoices_data. Before run: set `:company_id`; set date range (`:date_from` / `:date_to`). Parameterized for multi-tenant reuse; review joins before production.

### sql_0002 — Export Queries
- **Category:** invoicing
- **Tables:** addresses, attribute_values, attributes, brands, contact_categories, contacts, countries, currencies, groups, inventory, locations, origins, payment_terms, people, price_book, product_field_values, product_fields, products, products_categories, products_skus, sales, status, taxcodes, units, users
- **Description:** Invoice/credit reconciliation query for "Export Queries". Primary tables: addresses, attribute_values, attributes, brands, contact_categories. Before run: set `:company_id`; set date range (`:date_from` / `:date_to`). Parameterized for multi-tenant reuse; review joins before production.

### sql_0003 — … Natural Human Language Schema
- **Category:** schema
- **Tables:** company, consignment, external, location, parent
- **Description:** This is the entire database schema of … in human language for AI training/learning/understanding.

### sql_0004 — Company Email List
- **Category:** contacts
- **Tables:** —
- **Description:** For release notes, send to these emails

### sql_0005 — Sales By Customer Report
- **Category:** invoicing
- **Tables:** contacts, groups, products, sales, sales_items
- **Description:** This will get the monthly sales report from customers including head office qty

## Buy
| Call | Price | Body |
|------|------:|------|
| POST /v0/sql-catalog | **0.02 USDC** | `{}` or `{"category":"sales"}` — full metadata list (no SQL) |
| POST /v0/sql-search | **0.015 USDC** | `{"q":"products never sold","limit":8,"includeSql":true}` |
| POST /v0/sql-query | **0.025 USDC** | `{"id":"sql_0007"}` — one parameterized SQL pack |

Base: https://x402.devvizion.com