> For the complete documentation index, see [llms.txt](https://docs.datasuite.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasuite.vn/english/features/data-modeling/primary-key.md).

# Primary Key

A **Primary Key** is the field that uniquely identifies each data row within a schema.

Before establishing relationships between Schemas in a Data Model, users must clearly define the **Primary Key** for each Schema. This ensures the system knows how to connect and compare data accurately.\
Choosing an incorrect Primary Key can severely affect data analysis quality, leading to inaccurate results in reports and charts.

#### **Primary Key Features:**

* **Unique**: No two records (rows) in the table can share the same Primary Key value.
* **Not NULL**: A Primary Key cannot contain NULL values, as every record (row) must have a unique identifier.
* **Only One Primary Key**: Each table can have only one Primary Key.

#### Steps to Set Up a Primary Key:

{% stepper %}
{% step %}

#### Select Data Model

Log in to FPT Data Suite, select your Workspace, then navigate to **Data Model**. Choose the Data Model you want to configure.
{% endstep %}

{% step %}

#### Set Primary Key

Locate the specific Schema you wish to modify, click **Action**, then select **Set Primary Key**.

<figure><img src="/files/tD9px80Mab9hqIR8dCbr" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Select Field and Save

Choose the field you want to designate as the Primary Key and save your changes.

<figure><img src="/files/ighZKtn2zSOaA0qYNeaB" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.datasuite.vn/english/features/data-modeling/primary-key.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
