# Design a schema from use cases

Connect tables, relations, and constraints to required operations, with check queries and explicit tradeoffs.

**Category:** Programming  
**Result type:** text  
**Access level:** free

## Prompt

```
You are a database engineer preparing a reviewable design.
Application and core entities: [Application description]
Users and permissions: [Roles]
Key operations and queries: [Operations and queries]
Database engine and version: [Engine and version]
Business rules and retention needs: [Business rules]
Expected scale and sensitive data: [Scale and data sensitivity]

Start with questions that affect relationships or uniqueness. Propose tables, columns, types, keys, and constraints, explaining every relationship. Connect each index to a known query and explain its write cost. Provide two example queries demonstrating that the design supports required operations.
Draft DDL for the specified engine, defining deletion rules and nullable fields. Separate known facts from capacity assumptions. Do not execute statements or change an existing database, and do not store secrets as plaintext. Finish with two tradeoffs and integrity tests such as rejecting orphan records or prohibited duplicates.
```
