
Using Structured Query Language (SQL) for automation is nothing new. SQL databases have been working in the background of many different systems for decades, but even today there are some who are hesitant to mix SQL with industrial automation software like supervisory control and data acquisition (SCADA). However, as more SCADA software users feel the pressure of keeping up in today’s connected, data-driven world, SQL has received more well-deserved attention.
A database can often be one of the most important components of any control system. Over many years of development, it has become increasingly clear that control systems integrated with databases that use open standards (such as SQL) have a major advantage over systems that use proprietary databases, which is why the combination of SQL and the Ignition industrial application platform is so valuable.
Ignition is a cross-platform, modular, server-based software that centralizes everything on your plant floor, including SCADA, manufacturing execution system (MES), Industrial Internet of Things (IIoT), human-machine interfaces (HMIs), alarming, reporting, and more into one platform. It also allows you to seamlessly connect to all your SQL databases and deploy unlimited clients on desktop, tablets, and mobile devices. By making open-standard and open-source technologies like web services, SQL, MQTT, OPC UA, and others easily accessible, Ignition offers greater scalability and connectivity with your enterprise data. In this article, we will explore SQL databases, why SQL continues to be so popular and useful, and the limitless potential of integrating SQL databases with your control system, as well as time-series data and its importance.

The SQL Programming Language
According to the American National Standards Institute (ANSI), SQL is the standard programming language for managing data in a relational database management system (RDBMS) and the one of the most widely used languages for relational databases. It was first developed for IBM in the 1970s and has been used consistently for almost 50 years to store and manage data in SQL databases.
Its main function is to quickly and efficiently ask questions of small to very large amounts of data using SQL statements, or “queries,” which allow you to store, update, retrieve, search, or remove specific data in a database. Software engineers construct SQL queries using various components of the SQL language, such as identifiers, variables, and search conditions, to form the correct statement. They can also save SQL queries for later use as “stored procedures” so you don’t have to rewrite frequently used queries. These capabilities are part of what makes SQL so efficient, and even proprietary databases often use the same basic structure.

SQL Relational Databases
While all databases store data for future or continuous use, there are many types of databases, which are differentiated by their structure. The most widely used type are called relational databases. In a relational database, each data point is related to its surrounding data, and its function is to organize and retrieve relational data.
“SQL databases are one of the most important technologies that are used for data storage and access retrieval,” says Inductive Automation Chief Technology Architect Kevin McClusky.
You can think of a SQL database as having two main functions: access retrieval, which is performed using SQL; and storage, which is performed using the database engine. SQL databases organize data into files and specific storage areas on a physical hard disk or online servers in a cloud-based SQL database.
A SQL database is structured similarly to Excel tables with rows, columns, and cells, which makes organizing and retrieving any amount of data easy. This structure is especially useful for real-time and time-series (or historical) data. It helps to organize data that’s related to other data into tables by commonality, showing a picture of an event or data set. One of the most powerful aspects of a SQL database is its ability to “query” or ask questions of data and establish relationships with it. SQL queries allow you to perform analysis, answer complex questions, and manipulate and aggregate data without many steps so you can retrieve specific data from multiple tables, associate records with common field types, leverage the relationships within your data, and control precisely where data goes and what data is excluded.

For example, a company could have two different tables for their employees — one for their personal data, such as name, address, and birth date, and another table that contains details about each employee’s salary. While the employees and salaries tables exist separately within the database, their data can be associated with one another, and potentially retrieved together. This association is accomplished by establishing a unique identifier (commonly known as a primary key) in one table that can be referenced in the other table. For example, the employee’s unique ID number could be a primary key in the employees table, and that ID could be used as a foreign identifier (commonly known as a foreign key) in the salaries table. This allows the data for an employee in the employees table to be associated with their salary data in the salaries table, all through the single value of their unique employee ID. The ability to create this association, or relation, is the reason these types of databases are referred to as relational databases.
Read the full article to explore why SQL remains a cornerstone of control system databases.
Sponsored content by Inductive Automation