# Tables

Tables are a useful means for storing and accessing structured data. A table is composed of columns or fields of a particular type like text, integers, or real numbers. Each row or record is an instance of data. Each record or row has a unique identifier (called a primary key) which is often chosen as an integer starting at one. In comparison, ID numbers issued to citizens are similarly unique for identification purposes.

{% content-ref url="tables/create-table" %}
[create-table](https://docs.informationhub.io/tables/create-table)
{% endcontent-ref %}

{% content-ref url="tables/create-table-from-data" %}
[create-table-from-data](https://docs.informationhub.io/tables/create-table-from-data)
{% endcontent-ref %}

{% content-ref url="tables/view-data-in-table" %}
[view-data-in-table](https://docs.informationhub.io/tables/view-data-in-table)
{% endcontent-ref %}

#### List Tables

One can view all the tables in a project by using the navigation bar and selecting the “Tables” section.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-35f959205c1b06e52aee42490a283b2545362970%2Ffigure_48.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-af045be51b346c31fd7cf4a1972abb5367c411ee%2Ffigure_49.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

#### View Table

After selecting one of the listed tables inside a project one will be able to inspect the data contained within the table.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-6a5ca0efcf8207c9808e4a85fc8111bc9b5a5f57%2Ffigure_50.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

####

#### Create Table

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-f4925a385cd2e6932f92ca16c4e00e4e6bf26332%2Ffigure_51.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

One can create a new table from the page that lists the existing tables inside a project.

To create a table one must provide a unique name for the table.

An optional description can be added and is recommended to document useful information.

A primary key column must be created for a table to uniquely identify every data record, or row in the table. It is noteworthy that Excel and Google sheets do use a mechanism akin to primary keys in the form of row numbers.

One can add more columns by selecting the round plus button. When columns are added a unique name must be chosen. Each column must specify the data type (integers, real, text) of the values stored within.

#### Import Data

Instead of manually adding all the columns to create a table, one can import data (including columns and data) from csv or tsv files. Note that files have to be uploaded to storage (see section on storage) in order for it to be accessible.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-0490ed02f24342794c375c255d066d24ac7ce6e2%2Ffigure_54.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

After choosing to import data from storage, one may have to navigate through folders depending on how data has been organized in your project.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-ecc991e7cb72e815e5c9f874d0516ba9f2985ce6%2Ffigure_55.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Press select to import an appropriate csv file.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-ed247c4bed6c1e5f1444eabc809aabb133fe3ee0%2Ffigure_56.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

The column and data from the csv file is pulled into the table outline. The platform automatically detects the data type and name for each column. It might be necessary to make manual adjustments.

#### Add Column

One can select any of the highlighted plus signs to add more columns.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-36e9991dd59cdfb1d8b647c943c106024b5a9f63%2Ffigure_57.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-9984c01dcc22cb55dc52b40cd3545dcdae058727%2Ffigure_58.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

A popup menu allows one to create a new column

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-134fd0c6f0d5c8d3394a22743c784871959633b6%2Ffigure_59.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Each column must have a name and a chosen data type.

#### Update Column

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-d29056292eac6092dcf94898d2335021e8d2d164%2Ffigure_60.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

To update or alter a column select the edit button.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-74fd23751f69942afdd69d8847f9fe56b117f45b%2Ffigure_61.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Column details can be altered and updated. Select the update button to apply changes. Keep in mind that if there is data in the table, changes may fail due to data type mismatch. In some cases it is better to create a new column, instead of altering an existing column data type.

#### Remove Column

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-bab05bfaaabe02ab0c26addf4ae884e960d49a81%2Ffigure_62.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Deleting or removing a column is a straightforward process. After selecting to edit a column one can select the delete button and confirm the choice. Note that all data in the column will be destroyed by the action.

#### Add Row

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-4eb5f3ebe31b3b71c5dcbfa8d6ecf0c29f31819c%2Ffigure_63.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Adding a row is similar to adding a column by selecting one of the appropriate addition symbols to add a new row.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-d3536652f902b703bf9a2c814deb6f83f06eb49a%2Ffigure_64.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

To add a row, one must provide data for the columns. Note that the row number or primary key is handled in the background.

Update Row

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-bb496ed1ae05d2780b2ea0f67852fbf39041cfa8%2Ffigure_65.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Select the edit row button

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-0d5405d73e67849ac0070b9ce3bbe3afae8ca949%2Ffigure_66.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Make any necessary changes and update the row or data entries.

#### Remove Row

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-e45ed486ef3b8d1381f2cb6fb2f7494f10631331%2Ffigure_67.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Select rows to be deleted with the checkbox. Select the delete rows button

#### Sorting

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-c48f11498faebd5a7fca0ced29021393e94b086d%2Ffigure_68.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

One can sort rows by tapping the ordering button in a column. Tapping it again swaps between ascending and descending order.

#### Exporting

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-3ece79efc4b17d675a14e20cd611afba1c255528%2Ffigure_69.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>

Clicking the export button exports the table and its data to a tab separated value file in a downloads folder one can find under storage.

#### Searching

#### Analysing

Analysis works best on a desktop environment. One can generate a template Python or R script to pull data from the table stored on the information hub to your machine for analysis and processing.

<figure><img src="https://1809992964-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMJzjCgkNvy1LoumVjYBp%2Fuploads%2Fgit-blob-e994ff99f9039e04e091941dfcd505dd6af62dae%2Ffigure_71.png?alt=media" alt="" width="375"><figcaption></figcaption></figure>


---

# Agent Instructions: 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:

```
GET https://docs.informationhub.io/tables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
