Database Category
Rietta's database posts cover SQL injection defense, building SQL views in Rails with rake tasks, and using SQL views like Scenic to build complex reports.
Subscribe to Database posts via RSS
02/04/2026
Protect Production SQL Databases from AI/LLM Agentic SQL Query Risks
by Frank Rietta
Stop AI agents from destroying your data. Use read replicas and SQL lexical validation to create deterministic guardrails for LLM-based query agents.
Read More: Protect Production SQL Databases from AI/LLM Agentic SQL Query Risks
06/11/2024
A Journey From QBasic Random Access Files to PostgreSQL
by Frank Rietta
The evolution of data storage from a seasoned developer's perspective: from QBasic's random access files to PostgreSQL transactions and multi-user databases.
Read More: A Journey From QBasic Random Access Files to PostgreSQL
10/24/2019
MySQL Decimal Data Type
by Alex Piechowski
The MySQL decimal (A.K.A. numeric) data type stores exact values with a fixed point decimal. The syntax of MySQL's decimal is "DECIMAL(precision, scale)".
06/04/2019
Best Data Type to store Money in MySQL?
by Alex Piechowski
When handling currency in MySQL, use DECIMAL(13,2) for general use and DECIMAL(13,4) if GAAP Compliance is needed.
04/15/2019
How to calculate age in MySQL
by Matt Bettinson
While PostgreSQL has a built in age command, MySQL does not. How do we figure out somebody's age in MySQL?
03/30/2015
Adding a Rake Task for SQL Views to a Rails Project
by Frank Rietta
How to keep SQL views as .sql files in db/sql_views and add a custom 'rake db:views' task to a Rails project, treating database views like ActiveRecord models.
Read More: Adding a Rake Task for SQL Views to a Rails Project
02/11/2014
Reset MySQL Root Password with One Command
by Frank Rietta
One simple command to reset your MySQL root password on Debian/Ubuntu Linux. Don't overthink this one.
11/28/2013
How to use SQL views to Build Reports with Ruby on Rails
by Frank Rietta
SQL views help rationalize complex reports. Rails doesn't ship with SQL view support, but the Ruby gem Scenic is very effective at using SQL views in Rails.
Read More: How to use SQL views to Build Reports with Ruby on Rails
04/17/2012
Big data a big deal for SQL Server 2012, users say
by Frank Rietta
Read More: Big data a big deal for SQL Server 2012, users say