# SQL Query Execution Component
This component allows users to execute SQL queries and retrieve the results in the form of tables. It is particularly useful when dealing with database analytics, report generation, or any instance where SQL queries need to be applied to a set of data tables.
## Inputs
The input to this component consists of two parts:
1. **SQL Queries**: A dataframe that must contain a column named `query`. Each entry in this column represents an SQL query to be executed against the provided tables.
2. **Data Tables**: One or more data tables that the SQL queries will be executed upon. These tables serve as the data sources for the queries.
## Outputs
The output from this component is a sequence of tables, each corresponding to the result of one of the SQL queries provided. If a query is executed successfully, its corresponding output table will contain the resulting data. If there is an error during execution, the output table will contain an `error` column with the error message.
## Configuration
The behavior of the SQL Query Execution Component can be configured using the following parameters:
| Parameter | Type | Optional | Description |
|-----------|----------------------------------|----------|-----------------------------------------------------------------------------------------------------|
| `aliases` | list of strings or dictionary | Yes | Aliases for the data tables to be used within the SQL queries. |
### Aliases
Aliases are an optional configuration that allows setting user-friendly identifiers for the data tables when referenced in the SQL queries. They are particularly useful when the queries need to reference specific tables multiple times or when simplifying the query syntax.
There are two ways to specify aliases:
1. As a **list of strings**: Aliases will be applied to the tables in the order they're provided. For example, if you provide `["users", "transactions"]`, the first table will be accessible in the queries as `users`, and the second as `transactions`.
2. As a **dictionary**: This is useful when you want to assign specific aliases to specific tables. The dictionary maps table indices to their aliases. For example, if you have `{0: "users", 1: "transactions"}`, the first table will be accessible as `users`, and the second as `transactions`. The indices in the dictionary can be either integer or string representations of the integer index.
If no aliases are provided, the system will generate default aliases in the form of `table_0`, `table_1`, etc.
Remember that assigning meaningful aliases can make your SQL queries much easier to understand and maintain.
---
Use this component to effectively perform complex data manipulations and analyses with the power of SQL, all within the accessible environment of our platform. Happy querying!