# Backend Queries

> SQLAlchemy query optimization and data retrieval for stock_picker_bot. Covers efficient querying of historical stock data, portfolio lookups, and stock market analytics.

- Skill: `majiayu000/backend-queries-5` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/backend-queries-5`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/backend-queries-5/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Data & Analytics
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/backend-queries-5

---


# Backend Queries

This Skill provides Claude Code with specific guidance on how to adhere to coding standards as they relate to SQLAlchemy queries in the stock_picker_bot backend.

## When to use this skill

Use this skill when:

1. Writing SQLAlchemy queries to retrieve stock data from aiosqlite database
2. Implementing efficient queries for portfolio data with relationships and filters
3. Fetching historical stock prices for technical analysis and trend calculations
4. Joining stock tables with portfolio associations and user watchlists
5. Implementing pagination for large result sets in stock data endpoints
6. Optimizing queries with eager loading or joins to reduce database round trips
7. Filtering stocks by criteria like market cap, price range, or performance metrics
8. Aggregating stock data for portfolio performance calculations or comparisons

## Instructions

For details, refer to the information provided in this file:
[backend queries](../../../agent-os/standards/backend/queries.md)

