> ## Documentation Index
> Fetch the complete documentation index at: https://docs.serial.okos.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Parametric Qualitative

> An in-depth look at the structure and purpose of the `parametric_qualitative` table in the Serial database

## Introduction to the Parametric\_Qualitative Table

The parametric\_qualitative table is designed to store qualitative parametric data within the Serial database. This table plays a crucial role in the system by capturing text-based measurements or observations associated with specific process entries and unique identifiers.

## Table Structure

The parametric\_qualitative table is structured to efficiently store and relate qualitative data to other entities in the database. Here's a detailed breakdown of its columns:

| Column Name            | Data Type                | Constraints                                 | Description                             |
| ---------------------- | ------------------------ | ------------------------------------------- | --------------------------------------- |
| id                     | uuid                     | primary key                                 | Unique identifier for each entry        |
| company\_id            | uuid                     | not null, foreign key (companies)           | Associated company ID                   |
| process\_entry\_id     | uuid                     | not null, foreign key (process\_entries)    | Related process entry ID                |
| unique\_identifier\_id | uuid                     | not null, foreign key (unique\_identifiers) | Associated unique identifier ID         |
| value                  | text                     | not null                                    | The actual qualitative value stored     |
| dataset\_id            | uuid                     | not null, foreign key (datasets)            | ID of the dataset this entry belongs to |
| created\_at            | timestamp with time zone | not null, default now()                     | Timestamp of when the entry was created |

## Usage and Functionality

The parametric\_qualitative table is designed to be a flexible and integral part of the data collection system. Here are some key points about its usage:

1. **Qualitative Data Storage**: This table specifically handles text-based parametric data, allowing for the storage of descriptive or categorical information that can't be represented numerically.

2. **Process and Identifier Association**: Each entry in the table is linked to a specific process entry and unique identifier, allowing for precise tracking of qualitative data throughout the manufacturing or inspection process.

3. **Dataset Organization**: The inclusion of a dataset\_id allows for grouping related qualitative parameters, which can be useful for reporting and analysis purposes.

## Notes

* Insertion policies are in place to ensure that users can only add data for their associated company, as demonstrated by this SQL policy:

  ```sql
  CREATE POLICY "Insert - Data - SameCompany" ON "public"."parametric_qualitative"
  FOR INSERT TO "authenticated"
  WITH CHECK (("company_id" IN ( SELECT "privileges"."company_id"
     FROM "public"."privileges"
    WHERE ("privileges"."supabase_uid" = "auth"."user_id"()))));
  ```

* This table works in conjunction with the parametric\_quantitative table to provide a complete picture of parametric data in the system. While parametric\_qualitative handles text-based data, parametric\_quantitative would handle numerical measurements.

By leveraging the parametric\_qualitative table, the Serial application can effectively capture, store, and manage qualitative parametric data, enabling comprehensive tracking and analysis of non-numerical attributes throughout the manufacturing or quality control process.
