Skip to main content
thoughtbot thoughtbot
  • Live on Twitch!

    thoughtbot is livestreaming

    Work alongside the thoughtbot team as we collaborate with each other and our clients, live. Ask us anything, we're live right now!

  • Case Studies
  • Blog
  • Let’s Talk
Live on Twitch!

thoughtbot is livestreaming

Work alongside the thoughtbot team as we collaborate with each other and our clients, live. Ask us anything, we're live right now!

Let’s get started!
View all Services
Development
  • Ruby on Rails
  • Hotwire
  • AI and Machine Learning
  • Maintenance
  • Mobile
Design
  • Discovery Sprints
  • UX, UI, and Product Design
  • Design Systems
Product
  • MVP
  • Product Management
  • Accessibility
Team and Processes
  • Team Augmentation
  • Fractional Leadership
View all Services
View all Resources
Development
  • Tech Leadership Resources
  • Open Source
  • Books
  • The Bike Shed Podcast
  • Live Streaming on YouTube
  • Conference Talks
The business of great software
  • Playbook
  • Purpose Built
  • Giant Robots Smashing Into Other Giant Robots Podcast
  • Design Sprint Guide
  • Live Streaming on LinkedIn
View all Resources

SQL Articles

Written by thoughtbot, your expert partner for design and development.

    • All Topics
    • Design
    • Development
    • Product
    • More topics
  1. Postgres Window Functions

    Take your queries to the next level with window functions.

    Simon Taranto
    September 16, 2014
    • Web
    • Performance
    • PostgreSQL
    • SQL
  2. Why Postgres Won't Always Use an Index

    Use SQL EXPLAIN to understand when and why indexes are used (or not).

    Simon Taranto
    July 25, 2014
    • Web
    • Performance
    • PostgreSQL
    • SQL
  3. Back to Basics: Writing SQL Queries

    An in-depth overview of INSERT, SELECT, UPDATE, and DELETE statements, ORDER BY, INNER JOIN, LEFT OUTER JOIN, WHERE, GROUP BY, and HAVING clauses, and topics such as join tables and sub-queries.

    Britt Ballard
    April 21, 2014
    • Web
    • Back To Basics
    • SQL
  4. Refactoring Ruby Iteration Patterns to the Database

    Calculations across objects are ripe for using a map and an inject but frequently, with ActiveRecord, the solution is more elegant and faster if we can have SQL do the work instead.

    Simon Taranto
    April 15, 2014
    • Web
    • Rails
    • SQL
  5. Extract Mostly-Constant Data from the Database

    How moving some data out of the database and into your codebase as well-named constants can decouple your code and improve performance.

    Tute Costa
    April 11, 2014
    • Web
    • Rails
    • SQL
  6. A Grand Piano for Your Violin

    Thoughts on safe indexes to add to Rails app databases.

    Matt Jankowski
    August 15, 2009
    • Web
    • PostgreSQL
    • SQL
  7. depends

    Sometimes in an app you need to do something in SQL and not in your app’s...

    Jared Carroll
    July 31, 2007
    • Web
    • Rails
    • SQL
  8. don't be normal

    Database normalization, the database world’s equivalent of DRY, can lead you...

    Jared Carroll
    April 24, 2007
    • Web
    • Rails
    • SQL
  9. Sign up to receive a weekly recap from thoughtbot

    Looking for even more ways to stay connected?
    RSS feed icon Check out our feeds
« First ‹ Prev 1 2 3

Footer

thoughtbot
  • Services
  • Case Studies
  • Resources
  • Let's Talk
  • Our Company
  • Careers
  • Purpose
  • Blog
  • Sponsor
  • Mastodon
  • Bluesky
  • GitHub
  • YouTube
  • Twitch
  • Feeds
© 2025 thoughtbot, inc.

The design of a robot and thoughtbot are registered trademarks of thoughtbot, inc.

  • US: +1 (877) 9-ROBOTS
  • UK: +44 (0)20 3807 0560
  • Beware of fraudulent thoughtbot job listings Learn more
  • Code of Conduct
  • Accessibility Statement
  • Privacy Policy