database-sql

Design database schemas, write SQL queries, and create migrations.

23|2|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/asgarovf/locusai --skill database-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-sql
Source: https://github.com/asgarovf/locusai/tree/main/skills/database-sql
Command: npx skills add https://github.com/asgarovf/locusai --skill database-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines database management by assisting with schema design, writing efficient SQL queries, generating migrations, and optimizing performance.

Core Features & Use Cases

  • Schema Design: Provides best practices for table and column naming, data types, and common patterns.
  • SQL Querying: Offers examples for pagination, aggregation, CTEs, and upserts.
  • Migrations: Guides on creating and applying database schema changes using tools like Prisma or raw SQL.
  • Performance Tuning: Includes strategies for indexing and debugging query execution plans.
  • Use Case: You need to design a new products table for an e-commerce application, including appropriate data types, indexes, and a migration script.

Quick Start

Use the database-sql skill to generate a PostgreSQL CREATE TABLE statement for a 'products' table with columns for id, name, description, price, and created_at.

Frequently Asked Questions about database-sql

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

FAQPage Schema
How do I design a database schema with appropriate indexes and data types?

Database schema design involves selecting appropriate data types for columns, following table and column naming best practices, and implementing indexing strategies to optimize query performance across PostgreSQL and MySQL.

How do I write efficient SQL queries for pagination and aggregation?

Writing efficient SQL queries utilizes Common Table Expressions (CTEs), upserts, pagination, and aggregation techniques. Performance debugging is achieved by analyzing query execution plans using EXPLAIN ANALYZE to identify bottlenecks.

Does this SQL migration approach work with Prisma and TypeORM?

SQL migrations support integration with ORM tools including Prisma, Drizzle, TypeORM, and SQLAlchemy. This allows you to create and apply database schema changes using either raw SQL or your preferred ORM framework.

What's the best way to optimize slow PostgreSQL query performance?

Optimizing slow PostgreSQL query performance requires applying targeted indexing strategies and debugging execution plans with EXPLAIN ANALYZE. This identifies bottlenecks in your SQL queries to streamline database operations.

How do I generate a migration script for a new e-commerce products table?

Generating a migration script for a products table involves creating a CREATE TABLE statement with columns like id, name, description, price, and created_at, then applying the schema changes using raw SQL or an ORM tool.