sql-queries-tool
使用 AI 產生 SQL 查詢
為任何資料庫撰寫最佳化的 SQL 查詢。AI 會理解您的結構描述,並產生符合方言的安全查詢。
تنزيل ZIP المهارة
رفع في Claude
اذهب إلى Settings → Capabilities → Skills → Upload skill
فعّل وابدأ الاستخدام
اختبرها
استخدام "sql-queries-tool". Show me orders from last week
النتيجة المتوقعة:
上週有 **1,247 筆訂單**,總營收為 **$45,678.90**。平均訂單金額為 **$36.62**。
استخدام "sql-queries-tool". What columns does the products table have?
النتيجة المتوقعة:
products 資料表有 8 個欄位:id (integer)、name (varchar)、price (decimal)、category_id (integer)、stock_quantity (integer)、created_at (timestamp)、updated_at (timestamp)、is_active (boolean)。
التدقيق الأمني
آمنThis is a documentation-only skill file containing SQL query patterns and best practices. The static analyzer flagged 24 potential issues, but manual review confirms all are false positives. The backtick characters detected are markdown code fences for SQL examples. No cryptographic algorithms or system reconnaissance is present. The skill explicitly restricts queries to SELECT/WITH only, making it safe for database operations.
درجة الجودة
ماذا يمكنك بناءه
資料分析
產生聚合查詢、時間序列分析和報告查詢
應用程式開發
為應用程式後端撰寫高效的資料庫查詢
資料庫探索
預覽資料表資料並了解結構描述關係
جرّب هذه الموجهات
Show me the first 10 rows from the users table
Calculate total revenue per month for the last 6 months
Get the top 5 customers by order count with their total spending using a CTE
Show running total of transactions per user ordered by date
أفضل الممارسات
- 始終先使用 read_schema 或 describe_table 來了解結構描述
- 除非使用者明確要求所有資料列,否則應加入 LIMIT
- 引用所有識別碼:"schema"."table"."column"
- 為提高可讀性,優先使用 CTE 而非子查詢
تجنب
- 絕不產生 INSERT、UPDATE、DELETE 或 DROP 語句
- 避免在正式環境中使用 SELECT * - 應指定需要的欄位
- 不要在可能回傳大量資料集的查詢中省略 LIMIT
- 不要在未先檢查結構描述的情況下假設欄位名稱