--- title: "Execute ZCQL Query" url: https://docs.catalyst.zoho.com/en/sdk/android/v2/cloud-scale/zcql/execute-zcql-query/ description: "ZCQL is Catalyst's own query language that enables you to perform data creation, retrieval, and modification operations in the Data Store." last_updated: 2025-11-19T15:07:41Z service: Cloud Scale type: general related_links: - name: "Data Store" url: /en/cloud-scale/help/data-store/introduction - name: "ZCQL" url: /en/cloud-scale/help/zcql/introduction/ - name: "Execute ZCQL - API" url: /en/api/code-reference/cloud-scale/zcql/execute-zcql-query/#ExecuteZCQLQuery --- # ZCQL ZCQL is Catalyst's own query language that enables you to perform data creation, retrieval, and modification operations in the [Data Store](https://docs.catalyst.zoho.com/en/cloud-scale/help/data-store/introduction). It supports queries with built-in functions, SQL Join clauses, and other statements and conditions. ### Execute a ZCQL Query Before you execute a ZCQL query to fetch the required data set, you must construct the query to pass it to the `execute()` method. You can learn about the ZCQL syntax from the [ZCQL help page](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/introduction). You must pass an instance of `ZCatalystSelectQuery` to the `execute()` method, as shown in the code syntax of a ZCQL query execution below. The `<DATA_STORE_INSTANCE>` used here is the instance defined in the [Data Store Instance page](https://docs.catalyst.zoho.com/en/sdk/android/v2/cloud-scale/data-store/create-data-store-instance). ```bash ZCatalystApp.getInstance().getDataStoreInstance().execute( selectQuery: ZCatalystSelectQuery, success: (List<Map<String, Map<String, Any?>>>) → Unit, failure: ((ZCatalystException) → Unit)? ): ZCatalystRequest<ZCatalystResponse<List<Map<String, Any?>>>>>? ``` **Parameters**: * `selectQuery`: The instance of the type `ZCatalystSelectQuery` to be passed You can create a `selectQuery` instance for `ZCatalystSelectQuery` for the statements supported by ZCQL, in the following way: ```bash ZCatalystSelectQuery.Builder() .select(columns: Set<Column>): ZCatalystSelectQuery.Builder .selectAll(): ZCatalystSelectQuery.Builder .where(column: String, comparator: ZCatalystUtil.Comparator, value: String): ZCatalystSelectQuery.Builder .from(tableName: String): ZCatalystSelectQuery.Builder .and(column: String, comparator: ZCatalystUtil.Comparator, value: String): ZCatalystSelectQuery.Builder .groupBy(columns: Set<Column>): ZCatalystSelectQuery.Builder .orderBy(columns: Set<Column>, sortOrder: ZCatalystUtil.SortOrder): ZCatalystSelectQuery.Builder .innerJoin(tableName: String): ZCatalystSelectQuery.Builder .leftJoin(tableName: String): ZCatalystSelectQuery.Builder .on(joinColumn1: String, comparator: ZCatalystUtil.Comparator, joinColumn2: String): ZCatalystSelectQuery.Builder .or(column: String, comparator: ZCatalystUtil.Comparator, value: String): ZCatalystSelectQuery.Builder .limit(offset: Int, value: Int?): ZCatalystSelectQuery.Builder .build(): ZCatalystSelectQuery ``` A sample code snippet of a ZCQL query execution is shown below: ```bash val query = ZCatalystSelectQuery.Builder() .selectAll() .from("EmployeeDetails") //Replace this with your table name .where("Location", ZCatalystUtil.Comparator.EQUAL_TO, "Austin") .and("Department", ZCatalystUtil.Comparator.EQUAL_TO, "Marketing") .or("isActive", ZCatalystUtil.Comparator.EQUAL_TO, "true") .limit(5) .build() ZCatalystApp.getInstance().getDataStoreInstance().execute(query, { println("Query executed successfully. $it") }, { exception -> println("Exception occured $exception") }) ```