1
00:00:05,680 --> 00:00:10,630
Structured Query Language is an industry standard programming language for storing, processing, and

2
00:00:10,630 --> 00:00:13,570
querying data in most relational databases.

3
00:00:13,570 --> 00:00:17,590
There are three types of SQL commands that we're going to cover in this course.

4
00:00:17,800 --> 00:00:19,780
Data definition language.

5
00:00:19,780 --> 00:00:23,440
Data query language and data manipulation language.

6
00:00:23,440 --> 00:00:27,490
Data definition language is used to define database objects.

7
00:00:27,490 --> 00:00:34,840
We use commands like create and alter to create and update tables, views, and other database objects.

8
00:00:35,050 --> 00:00:39,460
Data query Language retrieves information from one or more tables.

9
00:00:39,460 --> 00:00:45,190
We use the Select statement with filter keywords such as where and order by.

10
00:00:45,820 --> 00:00:52,930
Data manipulation language creates, modifies and deletes data from the database tables using the insert,

11
00:00:52,930 --> 00:00:55,060
update and delete commands.

12
00:00:55,450 --> 00:00:59,860
SQL performs its functions through the following key characteristics.

13
00:00:59,890 --> 00:01:02,290
SQL is a declarative language.

14
00:01:02,290 --> 00:01:06,340
You write SQL commands that describe your desired results.

15
00:01:06,370 --> 00:01:11,830
SQL handles the details of how to retrieve the data and presents the correct results.

16
00:01:11,830 --> 00:01:15,280
So SQL is a Self-optimizing language.

17
00:01:15,700 --> 00:01:18,850
SQL is also a set oriented language.

18
00:01:18,850 --> 00:01:25,750
Its structure allows programmers to be free from concerns about opening and closing tables and managing

19
00:01:25,750 --> 00:01:26,470
files.

20
00:01:26,500 --> 00:01:29,830
SQL connects to the entire database at once.

21
00:01:29,860 --> 00:01:32,740
Finally, SQL is an embedded language.

22
00:01:32,770 --> 00:01:40,510
SQL can be embedded into many procedural languages such as Java, C, C plus plus, C, sharp, Visual

23
00:01:40,510 --> 00:01:48,160
Basic, VBA and VB scripting, structured Query Language includes data types that will be familiar to

24
00:01:48,160 --> 00:01:50,860
most automation and programming professionals.

25
00:01:50,860 --> 00:01:57,160
These include numbers, which are numeric values such as integers, floating point, and precise decimal

26
00:01:57,160 --> 00:01:57,790
numbers.

27
00:01:57,790 --> 00:02:05,440
It also includes date and time data types, as well as Ansi and Unicode format strings of both fixed

28
00:02:05,440 --> 00:02:06,940
length and variable length.

29
00:02:06,940 --> 00:02:13,750
SQL also includes Guids, which are globally unique identifiers which can be used as key fields.

30
00:02:13,750 --> 00:02:22,960
Other data types include binary variant image text table cursors, as well as user defined types or

31
00:02:22,990 --> 00:02:23,890
udts.

32
00:02:23,890 --> 00:02:31,450
SQL includes clauses to limit order and consolidate data returned by queries such as where order, by

33
00:02:31,450 --> 00:02:33,730
group, by having, and union.

34
00:02:33,730 --> 00:02:41,470
It also allows you to quantify data using keywords like in between, like is null and exists.

35
00:02:41,470 --> 00:02:47,860
There are familiar operators for equal and not equal to less than greater than, greater than or equal,

36
00:02:47,860 --> 00:02:56,350
less than or equal, and the familiar Boolean operators and, or and not Transact-sql or T-sql is a

37
00:02:56,350 --> 00:03:01,960
proprietary extension of the Structured Query Language, and it's central to the use of Microsoft SQL

38
00:03:01,960 --> 00:03:02,560
server.

39
00:03:02,560 --> 00:03:08,650
T-sql supports declared variables, string and data processing, error and exception handling, and

40
00:03:08,650 --> 00:03:09,940
transaction control.

41
00:03:09,940 --> 00:03:16,420
While SQL is a programming language, T-sql adds support for procedural programming and the use of local

42
00:03:16,420 --> 00:03:17,320
variables.

43
00:03:17,320 --> 00:03:24,550
SQL is heavily utilized in manufacturing industries for quality control, supply chain optimization,

44
00:03:24,550 --> 00:03:25,870
and inventory management.

45
00:03:25,900 --> 00:03:33,400
SQL can assist in tracking production data, managing material resources, and identifying areas for

46
00:03:33,400 --> 00:03:34,600
process improvement.

47
00:03:34,630 --> 00:03:38,080
SQL is also used for recipe and parameter sets.

48
00:03:38,080 --> 00:03:43,690
Many automation systems allow process parameter sets to be stored as recipe records in a database,

49
00:03:43,690 --> 00:03:46,840
which can be downloaded to the PLC when a changeover occurs.

50
00:03:46,840 --> 00:03:52,690
It can also be used as a production tracking system, generating detailed records for each product produced.

51
00:03:52,720 --> 00:03:58,180
SQL is also used for materials consumption planning, as it provides features including conversion from

52
00:03:58,180 --> 00:04:00,880
a customer's Po directly into a job order.

53
00:04:00,880 --> 00:04:06,460
In many cases, SQL can be used as a common data link between different automation systems in a plant,

54
00:04:06,460 --> 00:04:12,190
providing critical data exchange between different systems using an industry standard language.
