> For the complete documentation index, see [llms.txt](https://docs.zingy.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zingy.ai/app-editor/page-flow/references/prerequisite-for-data-examples.md).

# Prerequisite for Data examples

In order to make the usage examples of various Data blocks clear and easy to understand, we have created a common background or scenario, which we will explain in this section.

## Introduction Video

The following video serves as a great introduction to databases and also provides a general overview of data features in your Zingy app.

{% embed url="<https://youtu.be/3h_bRxORBlY>" %}
Video: Database Features
{% endembed %}

## Table Information

We will continue to use the example *Customers* [Database Table](/app-editor/data/database-tables.md) presented in the above video and also detailed below:

<div align="left"><figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FrxREPfJH9cX9sCo2q2G6%2Fimage.png?alt=media&amp;token=f1479c4c-59e8-4361-ad8b-900ead127896" alt="" width="563"><figcaption><p>Example Database Table about Customers</p></figcaption></figure></div>

## Sample Records

We will use the following sample records for the *Customers* [Database Table](/app-editor/data/database-tables.md).&#x20;

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2Fjm93DwEapBrb34khYmBj%2Fimage.png?alt=media&amp;token=a105d625-968a-4af1-a609-ff25ff35248c" alt=""><figcaption><p>Example records for the Customers table</p></figcaption></figure>

## Sample Queries

The following [queries](/app-editor/data/database-queries.md) are part of the *Customers* [Database Table](/app-editor/data/database-tables.md).&#x20;

* NameMatch

  <figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FF9ocB7nTqOqRbu8WQWzh%2Fimage.png?alt=media&amp;token=0d2ac82d-7232-4afd-b783-bbdb6a4eed03" alt=""><figcaption></figcaption></figure>

  This query will list records where either the value of the *FirstName* *OR* the *LastName* fields, contains the text specified in the Input-1 parameter.&#x20;
* NamePhoneMatch

  <figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2FahHgHg0ofgPkd107Hug9%2Fimage.png?alt=media&amp;token=c7c3c9e6-46e9-4c06-8034-35d4b2b3b0aa" alt=""><figcaption></figcaption></figure>

  This query will list records where the *PhoneNumber* field contains the text specified in the Input-2 parameter *AND* either of the *FirstName* or the *LastName* fields, contains the text specified in the Input-1 parameter.&#x20;

## Database Reading Logic for examples

For Page Flow/Cloud Flow blocks that are related to reading of database records, the following base logic is used:

* The [Data Read](/app-editor/page-flow/toolbox-blocks/data-read.md) block is used to read from the *Customers* [Database Table](/app-editor/data/database-tables.md) with the dataset name of *ds1*.
* The [Data Status](/app-editor/page-flow/toolbox-blocks/data-status.md) block is then used to check the status.&#x20;
* In the *Success Tasks* [Flow Parameter](/app-editor/page-flow/block-anatomy.md#flow-parameters) of the [Data Status](/app-editor/page-flow/toolbox-blocks/data-status.md) block, the function *Usage Example* is invoked.
* All examples will be shown implementing the *Usage Example* function containing the specific block being explained.

<figure><img src="https://3401585094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmnBepgycwgisXr9ya1N4%2Fuploads%2F5lIQlTeB0M4dCINJ4Czd%2Fimage.png?alt=media&amp;token=ca7636f7-7ecb-4aaf-bc0b-6b61cbd05c7e" alt=""><figcaption><p>Database reading logic for examples</p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zingy.ai/app-editor/page-flow/references/prerequisite-for-data-examples.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
