SQL Development
Guidelines for generating SQL statements and stored procedures
MCP get_skill({ skillId: "sql-development-098c8a7b" })Use this skill with your agent
Create a free account and connect via MCP
# SQL Development ## Database schema generation - all table names should be in singular form - all column names should be in singular form - all tables should have a primary key column named `id` - all tables should have a column named `created_at` to store the creation timestamp - all tables should have a column named `updated_at` to store the last update timestamp ## Database schema design - all tables should have a primary key constraint - all foreign key constraints should have a name - all foreign key constraints should be defined inline - all foreign key constraints should have `ON DELETE CASCADE` option - all foreign key constraints should have `ON UPDATE CASCADE` option - all foreign key constraints should reference the primary key of the parent table ## SQL Coding Style - use uppercase for SQL keywords (SELECT, FROM, WHERE) - use consistent indentation for nested queries and conditions - include comments to explain complex logic - break long queries into multiple lines for readability - organize clauses consistently (SELECT, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY) ## SQL Query Structure - use explicit column names in SELECT statements instead of SELECT * - qualify column names with table name or alias when using multiple tables - limit the use of subqueries when joins can be used instead - include LIMIT/TOP clauses to restrict result sets - use appropriate indexing for frequently queried columns - avoid using functions on indexed columns in WHERE clauses ## Stored Procedure Naming Conventions - prefix stored procedure names with 'usp_' - use PascalCase for stored procedure names - use descriptive names that indicate purpose (e.g., usp_GetCustomerOrders) - include plural noun when returning multiple records (e.g., usp_GetProducts) - include singular noun when returning single record (e.g., usp_GetProduct) ## Parameter Handling - prefix parameters with '@' - use camelCase for parameter names - provide default values for optional parameters - validate parameter values before use - document parameters with comments - arrange parameters consistently (required first, optional later) ## Stored Procedure Structure - include header comment block with description, parameters, and return values - return standardized error codes/messages - return result sets with consistent column order - use OUTPUT parameters for returning status information - prefix temporary tables with 'tmp_' ## SQL Security Best Practices - parameterize all queries to prevent SQL injection - use prepared statements when executing dynamic SQL - avoid embedding credentials in SQL scripts - implement proper error handling without exposing system details - avoid using dynamic SQL within stored procedures ## Transaction Management - explicitly begin and commit transactions - use appropriate isolation levels based on requirements - avoid long-running transactions that lock tables - use batch processing for large data operations - include SET NOCOUNT ON for stored procedures that modify data
Related Skills
More skills in Software Engineering
Accessibility Standards
Comprehensive web accessibility standards based on WCAG 2.2 AA, with 38+ anti-patterns, legal enforcement context (EAA, ADA Title II), WAI-ARIA patterns, and framework-specific fixes for modern web frameworks and libraries.
Accord
Authoring unified specification packages across Business/Development/Design teams via staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria). No code. Use when authoring cross-team specs, building L0-L3 packages, or aligning Biz/Dev/Design on a single source of truth.
Acquire Codebase Knowledge
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.
Acreadiness Assess
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc readiness` and hands off rendering to the @ai-readiness-reporter custom agent. Supports policies (--policy) for org-specific scoring. Use when asked to assess, audit, or score the AI readiness of a repo.
Acreadiness Generate Instructions
Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS Code) plus optional per-area .instructions.md files with applyTo globs for monorepos. Use after running /acreadiness-assess to close gaps in the AI Tooling pillar.
Acreadiness Policy
Help the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks, overriding impact/level, setting pass-rate thresholds, or chaining org baselines with team overrides. Use when the user asks about strict mode, AI-only scoring, custom weights, CI gating, or wants org-wide standardisation.
Explore Other Categories
Skills from other categories with shared topics
Cloud Design Patterns
Cloud design patterns for distributed systems architecture covering 42 industry-standard patterns across reliability, performance, messaging, security, and deployment categories. Use when designing, reviewing, or implementing distributed system architectures.
Gem Designer Mobile
Mobile UI/UX specialist — HIG, Material Design, safe areas, touch targets.
Image Manipulation Image Magick
Process and manipulate images using ImageMagick. Supports resizing, format conversion, batch processing, and retrieving image metadata. Use when working with images, creating thumbnails, resizing wallpapers, or performing batch image operations.