Loading...
Loading...
Convert natural language questions into SQL queries. Activates when users ask data questions in plain English like "show me users who signed up last week" or "find orders over $100".
npx skill4agent add clidey/whodb query-builderwhodb_tables(connection="...") → Get available tables
whodb_columns(table="relevant_table") → Get column names and typesSELECT columns
FROM table
[JOIN other_table ON condition]
WHERE filters
[GROUP BY columns]
[HAVING aggregate_condition]
ORDER BY column [ASC|DESC]
LIMIT n;whodb_query(query="generated SQL")| Natural Language | SQL Pattern |
|---|---|
| "last week/month/year" | |
| "more than X" / "greater than X" | |
| "top N" | |
| "how many" | |
| "total" / "sum of" | |
| "average" | |
| "for each" / "by" | |
| "between X and Y" | |
| "contains" / "like" | |
| "starts with" | |
| "is empty" / "is null" | |
| "is not empty" | |
WHERE created_at >= NOW() - INTERVAL '7 days'
WHERE created_at >= DATE_TRUNC('month', CURRENT_DATE)WHERE created_at >= DATE_SUB(NOW(), INTERVAL 7 DAY)
WHERE created_at >= DATE_FORMAT(NOW(), '%Y-%m-01')WHERE created_at >= DATE('now', '-7 days')
WHERE created_at >= DATE('now', 'start of month')SELECT * FROM users
WHERE created_at >= DATE_TRUNC('month', CURRENT_DATE)
ORDER BY created_at DESC;SELECT p.name, SUM(oi.quantity) as total_sold
FROM products p
JOIN order_items oi ON p.id = oi.product_id
GROUP BY p.id, p.name
ORDER BY total_sold DESC
LIMIT 5;SELECT customer_id, COUNT(*) as order_count
FROM orders
GROUP BY customer_id
ORDER BY order_count DESC;