Skip to main content
thoughtbot thoughtbot
  • We're live 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
We're live 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
  • Shaping Sprints
  • UX, UI, and Product Design
  • Design Systems
Product
  • MVP
  • Product Management
  • Accessibility
Team and Processes
  • Team Augmentation
  • Fractional Leadership
View all Services
  • Healthcare
  • Finance
  • Insurance
View all Resources
Development
  • Tech Leadership Resources
  • Open Source
  • Agent Skills
  • Books
  • The Bike Shed Podcast
  • Live Streaming on YouTube
  • Conference Talks
The business of great software
  • Playbook
  • 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. Detect anomalies in user behavior using Rails and PostgreSQL

    You probably use some type of error monitoring software to notify you when an exception is raised in your application, but are you being notified when there is an anomaly in user behavior?

    Steve Polito
    September 29, 2022
    • PostgreSQL
    • SQL
    • Analytics
    • Rails
  2. Query by Duration in Active Record

    How do you even save a “duration”, let alone query for records by that value? It’s actually easier than you think.

    Steve Polito
    June 7, 2022
    • Rails
    • Databases
    • PostgreSQL
    • Active Record
    • SQL
  3. Choosing the right database index type

    A quick introduction to which database index types are right for the task at hand in Postgresql.

    Greg Fisher
    December 16, 2021
    • PostgreSQL
    • SQL
    • Databases
    • Performance
  4. Understanding SQL GROUP BY

    Finally, you too can understand how to use GROUP BY in your SQL queries.

    Edward Loveall
    February 17, 2021
    • SQL
  5. Understanding SQL JOIN

    A mental model to understand SQL’s JOIN.

    Edward Loveall
    February 16, 2021
    • SQL
  6. Understanding SQL SELECT and WHERE

    See WHERE and SELECT visualized in this SQL primer.

    Edward Loveall
    February 15, 2021
    • SQL
  7. Breaking Out of Ecto Schemas

    With Ecto, 🎶 you can always get what you want. And if you try sometimes, well, you might find, you can select want you need 🎶.

    German Velasco
    February 24, 2020
    • Ecto
    • Elixir
    • SQL
    • Web
  8. Using doobie; Scala with PostgreSQL vs ActiveRecord

    I’ve wrapped up my second Scala client project, and I enjoyed SQL.

    Matt Sumner
    June 6, 2019
    • Ruby
    • Scala
    • SQL
  9. Back to basics: psql

    The right tool for the right job, right? Well let me introduce you to psql.

    German Velasco
    March 14, 2019
    • PostgreSQL
    • SQL
    • Back To Basics
  10. Better Date Manipulation in PostgreSQL Queries

    Use interval and date_trunc to make working with SQL dates easier.

    Derrick Carr
    September 19, 2017
    • PostgreSQL
    • SQL
    • Data
    • Web
  11. Sign up to receive a weekly recap from thoughtbot

    Looking for even more ways to stay connected?
    RSS feed Check out our feeds
« First ‹ Prev 1 2 3 4 Next › Last »

Footer

thoughtbot
  • Services
  • Case Studies
  • Resources
  • Let's Talk
  • Our Company
  • Careers
  • Purpose
  • Blog
  • Events
  • Sponsor
  • Store
  • Mastodon
  • Bluesky
  • GitHub
  • YouTube
  • Twitch
  • Feeds
© 2026 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
  • Code of Conduct
  • Accessibility Statement
  • Privacy Policy