SQL Ecosystem

Provide SQL patterns for DDL, DML, query optimization, and schema design.

Updated Mar 15, 2025
One-click install
npx skills add https://github.com/yasushiasahi/nix-config --skill sql-ecosystem-yasushiasahi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: SQL Ecosystem
Source: https://github.com/yasushiasahi/nix-config/tree/main/home-manager/agent-skills/skills/sql-ecosystem
Command: npx skills add https://github.com/yasushiasahi/nix-config --skill sql-ecosystem-yasushiasahi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you efficiently manage and interact with SQL databases, covering everything from basic data manipulation to complex query optimization and schema design.

Core Features & Use Cases

  • Data Definition (DDL): Create, alter, and manage tables and indexes.
  • Data Manipulation (DML): Insert, update, delete, and select data safely.
  • Query Optimization: Understand and apply techniques like JOINs, subqueries, CTEs, and window functions.
  • Schema Design: Learn about normalization and common design patterns.
  • Use Case: You need to write a complex query to find the top 5 customers by total spending in the last quarter, joining order and user data, and optimizing it for performance.

Quick Start

Use the SQL Ecosystem skill to generate a PostgreSQL CREATE TABLE statement for a 'products' table with 'id', 'name', and 'price' columns.

Frequently Asked Questions about SQL Ecosystem

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize complex SQL queries using JOINs and window functions?

Optimize SQL queries by applying best practices for JOINs, subqueries, CTEs, and window functions. This approach reduces execution time and improves database performance when retrieving complex datasets.

What is the best way to design a normalized database schema?

Database schema design uses normalization principles and common patterns to structure tables. Applying these schema design rules reduces data redundancy and ensures relational database integrity.

How do I write safe SQL queries to prevent SQL injection?

Prevent SQL injection by following safe query construction patterns provided for DML operations. This ensures data manipulation tasks like insert, update, and delete execute without exposing vulnerabilities.

Can I generate PostgreSQL CREATE TABLE statements with specific data types and constraints?

Generate PostgreSQL CREATE TABLE statements by defining columns with specific data types and constraints. This DDL operation creates structured tables ready for reliable data storage and manipulation.

When do I need to use CTEs and subqueries in SQL database operations?

Use CTEs and subqueries in SQL database operations to handle complex multi-step data retrieval logic. These query optimization techniques simplify reading and maintaining advanced data manipulation statements.

Does this SQL skill cover both DDL and DML operations for relational databases?

This skill covers both DDL and DML operations for relational databases. You can manage tables and indexes, and safely insert, update, delete, or select data using established patterns.