Writing SQL views and stored procedures by hand is tedious and error-prone. Just describe what you need and Claude will generate the full statement, handle the joins, and add comments explaining each section.
Write a SQL view called user_sales_summary that joins users, orders,
and order_items. Return: user_id, email, total_orders, total_revenue,
and last_order_date per user. Use MySQL syntax.
Claude handles complex aggregations, window functions, and conditional logic without you needing to remember the exact syntax. For Laravel, ask it to wrap the result in a migration:
Write a Laravel migration that creates or replaces a view called
active_subscriptions showing all subscriptions where status = 'active'
and expires_at > NOW(). Include the down() method to drop the view.
For stored procedures with parameters:
Write a MySQL stored procedure called calculate_user_tier that takes a
user_id parameter. Based on their total spend in the last 90 days,
return 'bronze', 'silver', or 'gold'. Add inline comments explaining the tiers.
Claude will generate the DELIMITER blocks, parameter declarations, and proper BEGIN...END structure — the parts that are easy to get wrong.
Your DBA hat is optional when Claude's writing the SQL.
Log in to leave a comment.
Set up Claude Code as an automated reviewer in your CI pipeline — on every pull request, it reads the diff, checks for bugs, security issues, missing tests, and convention violations, then posts its findings as a PR comment. Your human reviewers get a head start because the obvious issues are already flagged before they look.
Before deploying, tell Claude to read your project — migrations, environment variables, queue workers, scheduled tasks, caching, third-party integrations — and generate a deployment checklist that's specific to your app. Not a generic "did you run migrations?" list, but one that knows YOUR infrastructure and catches the things YOUR deploy can break.
Instead of writing a README from memory or copying a template, tell Claude to read your project and generate one that's actually accurate — real setup instructions from your config, real architecture from your directory structure, real API examples from your routes, and real prerequisites from your dependency files.