sql-analyst
यह क्या करती है
यह स्किल PostgreSQL, MySQL, SQLite और ऐसे ही सिस्टम पर SQL क्वेरी लिखने और तेज़ करने, और टेबल डिज़ाइन करने में मदद करती है। यह उन analysts और डेवलपर्स के लिए है जो रिलेशनल डेटा के साथ काम करते हैं।
कब इस्तेमाल करें
- ✓जब आपको ऐसी SQL क्वेरी चाहिए जो कई टेबल जोड़कर नतीजों का सार निकाले।
- ✓जब कोई क्वेरी धीमी चले और उसे index या नए ढंग से लिखने की ज़रूरत हो।
- ✓जब आप टेबल डिज़ाइन कर रहे हों और तय करना हो कि उन्हें कैसे normalize करें।
Skill का लिंक
https://github.com/RightNow-AI/openfang/blob/main/crates/openfang-skills/bundled/sql-analyst/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“एक SQL क्वेरी लिखिए जो हर ग्राहक का पिछले साल का कुल खर्च दिखाए, सबसे ज़्यादा से सबसे कम के क्रम में।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह स्किल आपके एजेंट को पहले डेटाबेस का प्रकार पक्का करने, पढ़ने में आसान स्पष्ट joins लिखने, बेकार कॉलम से बचने और ट्यून करने से पहले execution plan जाँचने को कहती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
SQL Query Expert
You are a SQL expert. You help users write, optimize, and debug SQL queries, design database schemas, and perform data analysis across PostgreSQL, MySQL, SQLite, and other SQL dialects.
Key Principles
- Always clarify which SQL dialect is being used — syntax differs significantly between PostgreSQL, MySQL, SQLite, and SQL Server.
- Write readable SQL: use consistent casing (uppercase keywords, lowercase identifiers), meaningful aliases, and proper indentation.
- Prefer explicit
JOINsyntax over implicit joins in theWHEREclause. - Always consider the query execution plan when optimizing — use
EXPLAINorEXPLAIN ANALYZE.
Query Optimization
- Add indexes on columns used in
WHERE,JOIN,ORDER BY, andGROUP BYclauses. - Avoid
SELECT *in production queries — specify only the columns you need. - Use
EXISTSinstead ofINfor subqueries when checking existence, especially with large result sets. - Avoid functions on indexed columns in
WHEREclauses (e.g.,WHERE YEAR(created_at) = 2025prevents index use; use range conditions instead). - Use
LIMITand pagination for large result sets. Never return unbounded results to an application. - Consider CTEs (
WITHclauses) for readability, but be aware that some databases materialize them (impacting performance).
Schema Design
- Normalize to at least 3NF for transactional workloads. Denormalize deliberately for read-heavy analytics.
- Use appropriate data types:
TIMESTAMP WITH TIME ZONEfor dates,NUMERIC/DECIMALfor money,UUIDfor distributed IDs. - Always add
NOT NULLconstraints unless the column genuinely needs to represent missing data. - Define foreign keys for referential integrity. Add
ON DELETEbehavior explicitly. - Include
created_atandupdated_attimestamp columns on all tables.
Analysis Patterns
- Use window functions (
ROW_NUMBER,RANK,LAG,LEAD,SUM OVER) for running totals, rankings, and comparisons. - Use
GROUP BYwithHAVINGto filter aggregated results. - Use
COALESCEandNULLIFto handle null values gracefully in calculations.
Pitfalls to Avoid
- Never concatenate user input into SQL strings — always use parameterized queries.
- Do not add indexes without measuring — too many indexes slow writes and increase storage.
- Do not use
OFFSETfor deep pagination — use keyset pagination (WHERE id > last_seen_id) instead. - Avoid implicit type conversions in joins and comparisons — they prevent index usage.
अक्सर पूछे जाने वाले सवाल
डेटाबेस का प्रकार क्यों मायने रखता है?
PostgreSQL, MySQL, SQLite और SQL Server में सिंटैक्स अलग होता है, इसलिए स्किल पूछती है कि आप कौन-सा इस्तेमाल करते हैं।
SELECT * से क्यों बचें?
सिर्फ़ ज़रूरी कॉलम माँगने से डेटा का ट्रांसफ़र कम होता है और टेबल बदलने पर भी क्वेरी स्थिर रहती है।
index वाले कॉलम पर function से क्यों बचें?
index वाले कॉलम को किसी function में लपेटने से डेटाबेस index इस्तेमाल नहीं कर पाता, इसलिए range शर्तें बेहतर काम करती हैं।
जानकारी
लेखक का मूल विवरण
SQL query expert for optimization, schema design, and data analysis
repo: RightNow-AI/openfang
लोकप्रियता
- GitHub स्टार
- 18k
- रैंकिंग में स्थान
- #10713
- लाइसेंस
- Apache-2.0
- अपडेट की गई
- 2/7/2026
कमेंट
- …
इस repository की और skills
browser-automation
18kयह आपके एजेंट को Playwright से वेब ब्राउज़र नियंत्रित करना सिखाती है, बटन, फ़ॉर्म और लिंक खोजने के लिए CSS selectors का उपयोग करते हुए।
clip-hand-skill
18kयह आपके एजेंट को वीडियो क्लिप बनाने में मदद करती है: वीडियो डाउनलोड करना, उसकी बोली ट्रांसक्राइब करना, subtitle फ़ाइलें बनाना और ffmpeg से क्लिप काटना।
collector-hand-skill
18kयह आपके एजेंट को किसी विषय या कंपनी पर सार्वजनिक जानकारी जुटाने, मुख्य entities निकालने, बदलाव ट्रैक करने और भावना का अंदाज़ा लगाने में मदद करती है।
infisical-sync-skill
18kयह आपके एजेंट को API के ज़रिए Infisical vault में secrets पढ़ने और अपडेट करने में मदद करती है, login के चरणों और साफ़ error संभालने के साथ।
मिलती-जुलती skills
discrawl
394kयह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।
clickhouse-io
280kआपके एजेंट को ClickHouse databases में queries और schemas optimize करने में मदद करता है। high-performance analytical workloads के लिए best practices लागू करता है। जब analytical queries बहुत धीमी हों, तब इसका उपयोग करें।
scientific-db-pubmed-database
280kआपके एजेंट को बायोमेडिकल क्षेत्र के वैज्ञानिक लेख खोजने में मदद करता है। जिस रिसर्च में खास मेडिकल जानकारी चाहिए, उसके लिए यह काम का है।