Home Explore Blog CI



nushell

6th chunk of `book/types_of_data.md`
c107d543b537b37c13ea4e18534910fcbcbab1aa5d6b0d1b0000000100000c99
|                       |                                                                                 |
| --------------------- | ------------------------------------------------------------------------------- |
| **_Description:_**    | Ordered sequence of zero or more values of any type                             |
| **_Annotation:_**     | `list`                                                                          |
| **_Literal Syntax:_** | See [Language Guide - List](/lang-guide/chapters/types/basic_types/list.md)     |
| **_See Also:_**       | [Working with Lists](./working_with_lists.md)                                   |
|                       | [Navigating and Accessing Structured Data](/book/navigating_structured_data.md) |

Simple example:

```nu
[Sam Fred George]
# => ╭───┬────────╮
# => │ 0 │ Sam    │
# => │ 1 │ Fred   │
# => │ 2 │ George │
# => ╰───┴────────╯
```

### Records

|                       |                                                                                 |
| --------------------- | ------------------------------------------------------------------------------- |
| **_Description:_**    | Holds key-value pairs which associate string keys with various data values.     |
| **_Annotation:_**     | `record`                                                                        |
| **_Literal Syntax:_** | See [Language Guide - Record](/lang-guide/chapters/types/basic_types/record.md) |
| **_See Also:_**       | [Working with Records](./working_with_records.md)                               |
|                       | [Navigating and Accessing Structured Data](/book/navigating_structured_data.md) |

Simple example:

```nu
let my_record = {
  name: "Kylian"
  rank: 99
}
$my_record
# => ╭───────┬────────────╮
# => │ name  │ Kylian     │
# => │ rank  │ 99         │
# => ╰───────┴────────────╯

$my_record | get name
# =>  Kylian
```

### Tables

|                    |                                                                                                                   |
| ------------------ | ----------------------------------------------------------------------------------------------------------------- |
| **_Description:_** | A two-dimensional container with both columns and rows where each cell can hold any basic or structured data type |
| **_Annotation:_**  | `table`                                                                                                           |
| **_See Also:_**    | [Working with Tables](./working_with_tables.md)                                                                   |
|                    | [Navigating and Accessing Structured Data](/book/navigating_structured_data.md)                                   |
|                    | [Language Guide - Table](/lang-guide/chapters/types/basic_types/table.md)                                         |

The table is a core data structure in Nushell. As you run commands, you'll see that many of them return tables as output. A table has both rows and columns.

Title: Structured Data Types in Nushell: Records and Tables
Summary
This section describes the structured data types 'Records', which are key-value pairs and shows an example of creating and accessing a record. It also covers 'Tables', a two-dimensional data structure with rows and columns that is core to Nushell.