← Files Formula GeniusARCHIVED FILE
skills/write-sql-query/SKILL.md
1.22 KB · Nov 12, 2026 · 18:13 UTC
--- name: write-sql-query description: "Write a SQL query for MySQL, PostgreSQL, SQL Server or SQLite from a plain-language request and a described schema. Do not use for spreadsheet formulas, regular expressions (write-regex) or VBA and Apps Script automation (draft-spreadsheet-automation)." --- Use this when the user wants a SQL query: a report, a join, a group-by total, a window function, a date filter, or an insert, update or delete. Confirm the database (`mysql`, `postgresql`, `sqlserver` or `sqlite`) and the tables and columns involved. Ask for a small schema description, never for credentials or a data dump. Call `generate_sql` with `request`, `database` and the schema in `context`. Return the query and explain what it reads or changes. For a query that updates or deletes rows, show a read-only `SELECT` of the affected rows first and remind the user to run it in a transaction or after a backup. The tool drafts SQL; it does not connect to or run anything in a database, so never say a query was executed. Stop on an authentication, credit or unsupported-file response and report it plainly. Do not route around it with another tool, mention prices or advertise an upgrade. Never create a share link unless the user asks for one.
SHA-256: c7a93d002ff2e88df63b7e399ba28fad10cf82003b17729cda60c1b334c851d7