# Oracle

Learn how to use the Oracle node in StackAI to query Oracle databases using natural language or SQL, with clear input and output examples.

**What is Oracle?**

The Oracle node in StackAI allows you to query Oracle databases directly from your workflow. You can use plain English or SQL queries to retrieve data, making it easy to access and analyze your database information without writing complex code.

**How to use it?**

To use the Oracle node, you need to provide two required inputs:

1. **Schema**: Describe your database schema, including tables, columns, and data types. This helps the node understand the structure of your database.
2. **Query**: Enter your question or request in plain English or as a SQL statement. The node will interpret your input, generate the appropriate SQL if needed, execute it, and return the results.

**Example of Usage**

Suppose you have a table called Employees with columns Name (TEXT), Department (TEXT), and Salary (REAL).

* **Schema (Required):**

  ```
  TABLE Employees (
    Name TEXT,
    Department TEXT,
    Salary REAL
  );
  ```
* **Query (Required):**

  ```
  What is the average salary in the Sales department?
  ```

**Inputs**

| Name   | Description                                                                 | Required | Example                                                      |
| ------ | --------------------------------------------------------------------------- | -------- | ------------------------------------------------------------ |
| Schema | Database Schema (tables, columns, types, etc.)                              | Yes      | `TABLE Employees (Name TEXT, Department TEXT, Salary REAL);` |
| Query  | Enter your query in plain English or SQL format to execute against database | Yes      | `Show me all employees in the Engineering department`        |

**Configurations**

* No additional configurations are required for the Oracle node. All you need is the schema and the query.

**Outputs**

| Name    | Description                     | Required | Example                                                         |
| ------- | ------------------------------- | -------- | --------------------------------------------------------------- |
| Query   | The SQL query that was executed | Yes      | `SELECT AVG(Salary) FROM Employees WHERE Department = 'Sales';` |
| Results | The results of the query        | Yes      | `[{"AVG(Salary)": 85000}]`                                      |

**Available Actions**

* **Query an Oracle Database**: Execute a query (in plain English or SQL) against your Oracle database and retrieve the results.

**Summary Table**

| Action Name              | Description                         | Required Inputs | Outputs        |
| ------------------------ | ----------------------------------- | --------------- | -------------- |
| Query an Oracle Database | Run queries on your Oracle database | Schema, Query   | Query, Results |

**How to use it in StackAI**

1. Add the Oracle node to your workflow.
2. Fill in the Schema with your database structure.
3. Enter your query in the Query field.
4. Connect the node to downstream nodes to use the results.

**Example Output**

* **Query**: `SELECT AVG(Salary) FROM Employees WHERE Department = 'Sales';`
* **Results**: `[{"AVG(Salary)": 85000}]`

This makes it easy to integrate Oracle database queries into your StackAI workflows for reporting, analytics, and automation.
