Structured Query Language is an industry standard programming language for storing, processing, and
querying data in most relational databases.
There are three types of SQL commands that we're going to cover in this course.
Data definition language.
Data query language and data manipulation language.
Data definition language is used to define database objects.
We use commands like create and alter to create and update tables, views, and other database objects.
Data query Language retrieves information from one or more tables.
We use the Select statement with filter keywords such as where and order by.
Data manipulation language creates, modifies and deletes data from the database tables using the insert,
update and delete commands.
SQL performs its functions through the following key characteristics.
SQL is a declarative language.
You write SQL commands that describe your desired results.
SQL handles the details of how to retrieve the data and presents the correct results.
So SQL is a Self-optimizing language.
SQL is also a set oriented language.
Its structure allows programmers to be free from concerns about opening and closing tables and managing
files.
SQL connects to the entire database at once.
Finally, SQL is an embedded language.
SQL can be embedded into many procedural languages such as Java, C, C plus plus, C, sharp, Visual
Basic, VBA and VB scripting, structured Query Language includes data types that will be familiar to
most automation and programming professionals.
These include numbers, which are numeric values such as integers, floating point, and precise decimal
numbers.
It also includes date and time data types, as well as Ansi and Unicode format strings of both fixed
length and variable length.
SQL also includes Guids, which are globally unique identifiers which can be used as key fields.
Other data types include binary variant image text table cursors, as well as user defined types or
udts.
SQL includes clauses to limit order and consolidate data returned by queries such as where order, by
group, by having, and union.
It also allows you to quantify data using keywords like in between, like is null and exists.
There are familiar operators for equal and not equal to less than greater than, greater than or equal,
less than or equal, and the familiar Boolean operators and, or and not Transact-sql or T-sql is a
proprietary extension of the Structured Query Language, and it's central to the use of Microsoft SQL
server.
T-sql supports declared variables, string and data processing, error and exception handling, and
transaction control.
While SQL is a programming language, T-sql adds support for procedural programming and the use of local
variables.
SQL is heavily utilized in manufacturing industries for quality control, supply chain optimization,
and inventory management.
SQL can assist in tracking production data, managing material resources, and identifying areas for
process improvement.
SQL is also used for recipe and parameter sets.
Many automation systems allow process parameter sets to be stored as recipe records in a database,
which can be downloaded to the PLC when a changeover occurs.
It can also be used as a production tracking system, generating detailed records for each product produced.
SQL is also used for materials consumption planning, as it provides features including conversion from
a customer's Po directly into a job order.
In many cases, SQL can be used as a common data link between different automation systems in a plant,
providing critical data exchange between different systems using an industry standard language.