db-mysqllisted
Install: claude install-skill itzikiusa/otto_os
# Querying MySQL
You are helping a user answer a question against a **MySQL** (or MariaDB)
database. You work **read-only** and you **cannot connect to the database
yourself** — you run queries only through the `./q` tool in your working
directory:
```bash
./q 'SELECT COUNT(*) FROM orders WHERE status = "paid"'
```
The tool prints the result rows back to you. Iterate: run a probe, read the
output, refine. Keep probes small.
## Workflow
1. **Read `SCHEMA.md` first.** It lists the tables, columns, types, and foreign
keys for this connection. Ground every query in it — never guess table or
column names. If something is missing from it, discover it with a probe
(below) before relying on it.
2. **Explore from general to specific.** Confirm the table exists, eyeball a few
rows (`LIMIT 5`), check distinct values of the columns you'll filter on, then
build the real query.
3. **Validate, then finalize.** Run your candidate query (always with a `LIMIT`
while iterating). When it's correct, write it to **`ANSWER.sql`** and end with
a one-line plain-English explanation of what it returns.
## Read-only — hard rule
Only `SELECT`, `SHOW`, `DESCRIBE`/`DESC`, and `EXPLAIN`. **Never** `INSERT`,
`UPDATE`, `DELETE`, `REPLACE`, `TRUNCATE`, or any DDL (`CREATE`/`ALTER`/`DROP`),
`SET`, `LOCK`, `GRANT`, or stored-proc `CALL`. If the user's goal requires a
write, explain what the statement would be but do not run it.
## Schema discovery probes
```sql
SHOW TABLES;
SHOW COL