To construct and execute an SQL Query you need to first identify the entities on which the SQL Query will operate upon. The basic entities that are essential for constructing an SQL query includes Database, Tables and Columns.
The following section describes the mapping in Zoho Reports that maps to these basic entities required for SQL querying. You need to use this mapping to construct your SQL queries for execution.
In Zoho Reports the mapping of the entities would be the following:
|SQL Query Entity||Zoho Reports mapping|
|Database||Mapped to each workspace in Zoho Reports|
|Table||Mapped to Tables and Query Tables in a database in Zoho Reports|
|Column||Mapped to Columns of a Table or Query Table in a database in Zoho Reports|
Following is an example of a CloudSQL query executed on Zoho Reports:
Entities involved in Zoho Reports:
Database Name in Zoho Reports : "Super Store Sales"
Table Name : Sales
Columns Involved : Customer Name, Sales, Cost and Region
SQL SELECT Query:
select "Customer Name",Sales,Cost,"Profit (Sales)" from Sales where Region = 'East'
The above query will fetch the records from the Sales table in Super Store Sales database in Zoho Reports, which are from the Region 'East'.