<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Database on Rietta Cybersecurity</title>
    <link>https://rietta.com/categories/database/</link>
    <description>Recent content in Database on Rietta Cybersecurity</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>1999-2026 Rietta Inc. All Rights Reserved.</copyright>
    <atom:link href="https://rietta.com/categories/database/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Protect Production SQL Databases from AI/LLM Agentic SQL Query Risks</title>
      <link>https://rietta.com/blog/ai-sql-database-data-protection-read-replica/</link>
      <pubDate>Wed, 04 Feb 2026 08:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/ai-sql-database-data-protection-read-replica/</guid>
      <description>Overview Many are concerned with how to protect production databases from AI query agents, a subset of AI coding agents, designed to assist in writing SQL queries against a database using natural-language prompts. It is helpful to think about this new capability as a pseudo-deterministic compiler that takes a prompt, reads the schema of the database, and produces dynamic queries that are executed against the production database with minimal human intervention.</description>
    </item>
    <item>
      <title>A Journey From QBasic Random Access Files to PostgreSQL</title>
      <link>https://rietta.com/blog/random-access-files-to-databases/</link>
      <pubDate>Tue, 11 Jun 2024 08:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/random-access-files-to-databases/</guid>
      <description>As a practicing developer, I have a good bit of experience working with software that needed to store data. In this article I am going to recount a brief history of the world of databases, the long version would take a book, as I personally experienced working on code for the last 28 years. This should be informative to readers who want to understand more about just how powerful modern database systems are in comparison.</description>
    </item>
    <item>
      <title>MySQL Decimal Data Type</title>
      <link>https://rietta.com/blog/mysql-decimal-data-type/</link>
      <pubDate>Thu, 24 Oct 2019 08:00:00 -0400</pubDate>
      <guid>https://rietta.com/blog/mysql-decimal-data-type/</guid>
      <description>In MySQL, the DECIMAL and NUMERIC data types store exact, fixed-point values. In MySQL, NUMERIC is implemented as a DECIMAL, so a NUMERIC and DECIMAL are the same data type. This data type is used when it is important to preserve the exact precision, such as storing money data.&#xA;Declaration In a DECIMAL column declaration, the precision and scale can be specified.&#xA;DECIMAL(13,2)This declaration declares a precision of 13 and a scale of 2.</description>
    </item>
    <item>
      <title>Best Data Type to store Money in MySQL?</title>
      <link>https://rietta.com/blog/best-data-types-for-currencymoney-in/</link>
      <pubDate>Tue, 04 Jun 2019 13:30:00 -0400</pubDate>
      <guid>https://rietta.com/blog/best-data-types-for-currencymoney-in/</guid>
      <description>&lt;h2 id=&#34;the-short-answer-tldr&#34;&gt;The Short Answer (TL;DR)&lt;/h2&gt;&#xA;&lt;h3 id=&#34;if-acronym-titlegenerally-accepted-accounting-principlesa-hrefhttpsenwikipediaorgwikigenerally_accepted_accounting_principles_united_statesgaapaacronym-compliance-is-required-or-you-need-4-decimalblogmysql-decimal-data-type-places&#34;&gt;If &lt;acronym title=&#34;Generally Accepted Accounting Principles&#34;&gt;&lt;a href=https://en.wikipedia.org/wiki/Generally_Accepted_Accounting_Principles_(United_States)&gt;GAAP&lt;/a&gt;&lt;/acronym&gt; Compliance is required or you need 4 &lt;a href=&#34;https://rietta.com/blog/mysql-decimal-data-type/&#34;&gt;decimal&lt;/a&gt; places:&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;DECIMAL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which supports a max value of:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$999,999,999.9999&lt;/code&gt;&lt;/p&gt;&#xA;&lt;h3 id=&#34;otherwise-if-2-decimal-places-is-enough&#34;&gt;Otherwise, if 2 decimal places is enough:&lt;/h3&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nb&#34;&gt;DECIMAL&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Which supports a max value of:&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;$99,999,999,999.99&lt;/code&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to calculate age in MySQL</title>
      <link>https://rietta.com/blog/calculating-age-in-mysql/</link>
      <pubDate>Mon, 15 Apr 2019 12:00:00 -0400</pubDate>
      <guid>https://rietta.com/blog/calculating-age-in-mysql/</guid>
      <description>&lt;p&gt;While PostgreSQL has a built in &lt;a href=&#34;https://www.postgresql.org/docs/8.4/functions-datetime.html&#34;&gt;age()&lt;/a&gt; command, MySQL does not. Imagine we have a users table with a &lt;code&gt;birthdate&lt;/code&gt; field and we need to figure out how old they are. We could accomplish this by subtracting the current date with the date the user was born on.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adding a Rake Task for SQL Views to a Rails Project</title>
      <link>https://rietta.com/blog/adding-rake-db-views-for-sql-views-to-a-rails-project/</link>
      <pubDate>Mon, 30 Mar 2015 12:00:00 -0400</pubDate>
      <guid>https://rietta.com/blog/adding-rake-db-views-for-sql-views-to-a-rails-project/</guid>
      <description>&lt;p&gt;I have previously written about &lt;a href=&#34;https://rietta.com/blog/rails-and-sql-views-for-a-report/&#34;&gt;Using Rails and SQL Views for a Report&lt;/a&gt;. A practical consideration when employing SQL views, which create wonderfully fast read-only tables that can be used by ActiveRecord models seamlessly, in a Ruby on Rails project is where to maintain them in a project.&lt;/p&gt;&#xA;&lt;p&gt;One approach is to use migrations, since that&amp;rsquo;s where database stuff normally goes. But a big downside is that this approach is not &lt;acronym title=&#34;Do Not Repeat Yourself - a common Ruby community refrain&#34;&gt;DRY&lt;/acronym&gt; because changing the SQL view requires a new migration that drops the old view and replaces it with the updated version. &lt;em&gt;Simply changing a field in the SQL view requires copying and pasting the entire definition over again&lt;/em&gt;. That&amp;rsquo;s just annoying!&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The second, and in my opinion better approach, is to treat SQL views more like models.&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Reset MySQL Root Password with One Command</title>
      <link>https://rietta.com/blog/reset-mysql-root-password-on-ubuntu-linux/</link>
      <pubDate>Tue, 11 Feb 2014 11:47:45 -0500</pubDate>
      <guid>https://rietta.com/blog/reset-mysql-root-password-on-ubuntu-linux/</guid>
      <description>&lt;p&gt;&lt;img src=&#34;https://rietta.com/images/posts/illustrations/locked_out.png&#34; alt=&#34;Locked Out, Again&#34;&gt;&lt;/p&gt;&#xA;&lt;p&gt;I have locked myself out of important accounts more than a few times. Just this morning, I found myself again locked out of a MySQL database server on an Ubuntu Linux machine. Though this should work with any Debian-based Linux that uses the &lt;code&gt;apt-get&lt;/code&gt; package management system.&lt;/p&gt;&#xA;&lt;p&gt;Fortunately, I had administrative access to the server through SSH and thus was able to reset the MySQL root password with the package management script. &lt;strong&gt;It only took one, simple command&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>How to use SQL views to Build Reports with Ruby on Rails</title>
      <link>https://rietta.com/blog/rails-and-sql-views-for-a-report/</link>
      <pubDate>Thu, 28 Nov 2013 10:54:00 +0000</pubDate>
      <guid>https://rietta.com/blog/rails-and-sql-views-for-a-report/</guid>
      <description>SQL views are a powerful capability of a relational database server. This functionality can be easily used to implement important reporting, data mining, and other functionality to a web application built with Ruby on Rails in a manner that may be faster and more concise than an implementation that uses only typical ActiveRecord patterns. The complexity of dealing with the relational data is abstracted away from the Rails application that is a consumer of the data, keeping the model, controllers, and Rails view concisely focused on their appropriate roles.</description>
    </item>
    <item>
      <title>Big data a big deal for SQL Server 2012, users say</title>
      <link>https://rietta.com/blog/big-data-big-deal-for-sql-server-2012/</link>
      <pubDate>Tue, 17 Apr 2012 00:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/big-data-big-deal-for-sql-server-2012/</guid>
      <description>TechTarget just published an article by Alan Earls in which both Sanjay Bhatia (of Izenda), a fellow founder of Atlanta-based database company (and ATDC graduate), and myself were quoted.&#xA;Big data a big deal for SQL Server 2012, users say:&#xA;For Frank Rietta, the fact that Microsoft has been willing to work with an established open source project is the best part of SQL Server 2012.&#xA;Rietta is talking about the Apache Hadoop integration with SQL Server 2012.</description>
    </item>
    <item>
      <title>Adding RANDOM alias to RAND in MySQL without Changing Ruby on Rails Code</title>
      <link>https://rietta.com/blog/adding-random-alias-to-rand-in-mysql/</link>
      <pubDate>Mon, 19 Dec 2011 00:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/adding-random-alias-to-rand-in-mysql/</guid>
      <description>&lt;p&gt;While building the new website for &lt;a href=&#34;http://www.sqlconverter.com&#34;&gt;http://www.sqlconverter.com&lt;/a&gt;, I recently ran into a slight compatibility issue between the SQLite3 database used for local initial development and MySQL when the site was prepared for production.  What was the compatibility issue?  It was the random function!&lt;/p&gt;</description>
    </item>
    <item>
      <title>A.R.M. Yourself Against SQL Injection</title>
      <link>https://rietta.com/blog/arm-yourself-against-sql-injection/</link>
      <pubDate>Tue, 08 Aug 2006 00:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/arm-yourself-against-sql-injection/</guid>
      <description>To effectively protect your web application from SQL injection attack, you must ARM yourself. That is, when writing applications, be sure to validate all input strings There are three, and only three, options when given a piece of data:&#xA;Accept it Reject it Modify it It might seem obvious that all input must be validated. Too often, webmasters and programmers are focused on getting a working application under time pressure and may not implement the best security practices.</description>
    </item>
    <item>
      <title>Business Analysis of Web Application Information</title>
      <link>https://rietta.com/blog/business-analysis-of-web-application-information/</link>
      <pubDate>Mon, 26 Dec 2005 19:23:00 +0000</pubDate>
      <guid>https://rietta.com/blog/business-analysis-of-web-application-information/</guid>
      <description>Gain Insight into Your Web Application&amp;rsquo;s Data through MySQL and Microsoft Excel Data Integration: An Important Reporting Tool Businesses often use a collection of independently developed applications, with vendor-supplied database layouts. In order to understand the big picture of the business it is important to pull information from multiple sources into a flexible analytical tool. One such tool is the ubiquitous spreadsheet application, such as Microsoft Excel, that is capable of pulling information from multiple sources and performing various analytical reporting functions.</description>
    </item>
    <item>
      <title>Part I: Introduction to SQL Injection</title>
      <link>https://rietta.com/blog/part-i-introduction-to-sql-injection/</link>
      <pubDate>Sat, 23 Apr 2005 00:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/part-i-introduction-to-sql-injection/</guid>
      <description>This is Part I of a serialization of a paper I have written on the SQL Injection defenses. As portions of the paper are finished I will post them on this blog. Topics will include a discussion on access control, security models, classification of attacks, and intrusion detection techniques.&#xA;SQL injection is a technique often used to exploit database systems through vulnerable web applications. The techniques allows the attacker to not only steal the entire contents of relational databases but also, in many cases, to make arbitrary changes to the both the database schema and contents.</description>
    </item>
    <item>
      <title>Symposium and Onward; SQL Lint</title>
      <link>https://rietta.com/blog/symposium-and-onward-sql-lint/</link>
      <pubDate>Thu, 14 Apr 2005 00:00:00 +0000</pubDate>
      <guid>https://rietta.com/blog/symposium-and-onward-sql-lint/</guid>
      <description>The UROC symposium, which was basically a poster conference, went very well. It was very interesting to see all of the undergraduate research that had gone on - from quantum cellular automata (QCA) for nano-computers to machine learning of simulated ant behavior. I was glad to get the feedback from the audience on the SQL Injection presentation and will continue to push to polish up the paper and set things up for the next stage of the work.</description>
    </item>
  </channel>
</rss>
