> 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="https://207765737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRDG3vvgCOF596sbdkH0%2Fuploads%2FHKqR8XXnZUW95soxjTop%2Fimage.png?alt=media&amp;token=b3d88d3a-c48d-4f38-b124-330d4f9bd02b" 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="https://207765737-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FpRDG3vvgCOF596sbdkH0%2Fuploads%2FL6xCJGpsD2W6kM9vV1BU%2Fimage.png?alt=media&amp;token=56f44239-61b5-49ce-b2f6-4db9a948362d" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
