Lesson Outcomes

By the end of this lesson, learners will be able to:

  • Understand what SQL is and its purpose
  • Describe how SQL is used to interact with databases
  • Perform basic SQL operations (querying, inserting, updating, deleting data)
  • Explain the role of SQL in database management and RPA

Lesson Overview

In this lesson, we dive into Structured Query Language (SQL) — the language used to communicate with databases.

If databases are like storage warehouses, then SQL is the forklift operator that knows exactly where everything is and how to move it around efficiently.

1. What is SQL?

SQL (Structured Query Language) is a standard programming language used to:

  • Access data
  • Retrieve data
  • Insert new data
  • Update existing data
  • Delete data

It is primarily used with relational databases.

2. Why SQL is Important

SQL is essential because:

  • It allows users to interact with databases easily
  • It provides structured and efficient data access
  • It is widely used across industries

👉 In RPA:

  • Bots use SQL to extract and update data automatically
  • Enables integration between systems

3. Basic SQL Operations

SQL is built around a few core operations:

a) SELECT (Retrieve Data)

Used to get data from a database.

 
SELECT name, age FROM employees;
 

👉 This retrieves names and ages from the “employees” table.

b) INSERT (Add Data)

 
INSERT INTO employees (name, age)
VALUES (‘John’, 30);
 

👉 Adds a new record to the table.

c) UPDATE (Modify Data)

 
UPDATE employees
SET age = 31
WHERE name = ‘John’;
 

👉 Updates existing data.

d) DELETE (Remove Data)

 
DELETE FROM employees
WHERE name = ‘John’;
 

👉 Removes data from the table.

4. SQL Structure (Tables, Rows, Columns)

Relational databases organise data into:

  • Tables → like spreadsheets
  • Rows → individual records
  • Columns → attributes (fields)

Example:

ID Name Age
1 John 30

5. SQL Queries and Conditions

SQL allows filtering using conditions:

 
SELECT * FROM employees
WHERE age > 25;
 

👉 This returns only employees older than 25.

Common operators:

  • = equal
  • > greater than
  • < less than
  • AND, OR for logic

6. SQL in Real-World Applications

SQL is used in:

  • Banking systems
  • E-commerce platforms
  • Healthcare databases
  • Government systems

👉 Anywhere data is stored, SQL is probably working behind the scenes.

7. SQL and RPA

In Robotic Process Automation:

  • Bots use SQL to:

    • Extract data from databases

    • Update records automatically

    • Generate reports

  • Enables automation of data-heavy processes

Example:

  • Fetch customer data
  • Process it
  • Update another system

8. Advantages of SQL

  • Easy to learn and use
  • Powerful for handling large datasets
  • Standardised across systems
  • Enables fast data retrieval

Lesson Summary

In this lesson, you learned that:

  • SQL is the language used to interact with databases
  • It allows you to retrieve, insert, update, and delete data
  • Data in databases is structured in tables, rows, and columns
  • SQL plays a critical role in automation and RPA systems