SQL

Rietta's SQL posts cover SQL injection defense, building SQL views in Rails, and storing currency correctly in relational databases.

06/04/2019

Best Data Type to store Money in MySQL?

When handling currency in MySQL, use DECIMAL(13,2) for general use and DECIMAL(13,4) if GAAP Compliance is needed.

Read More: Best Data Type to store Money in MySQL?

01/28/2019

Storing currency in PostgreSQL

There are different ways we can store currency in PostgreSQL, this blog post will cover the money and numeric type.

Read More: Storing currency in PostgreSQL

03/30/2015

Adding a Rake Task for SQL Views to a Rails Project

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

11/28/2013

How to use SQL views to Build Reports with Ruby on Rails

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/23/2005

Part I: Introduction to SQL Injection

Read More: Part I: Introduction to SQL Injection