Question
Implement a small in-memory database supporting table creation, row insertion, filtering, projection, and ordering.
```python
class Database:
def create_table(self, name: str, columns: list[str]) -> None: ...
def insert(self, table: str, row: dict) -> None: ...
def query(
self, table: str, columns=None, where=None, order_by=None
) -> list[dict]: ...
```
## Requirements
- Reject duplicate tables and rows containing unknown columns; define defaults for missing columns.
- `where`, when supplied, is a predicate over a row.
- Projection returns only requested existing columns and must not expose mutable internal rows.
- `order_by=(columns, ascending)` sorts lexicographically by listed columns with deterministic ties.
- Define null and mixed-type comparison behavior.
- Preserve insertion order when no ordering is requested.
## Follow-ups
1. Add joins and grouped aggregations.
2. Build an index for repeated equality predicates.
3. Add transactions and snapshot reads.
4. Parse a constrained SQL string into the query representation.