# Boolean

A logical boolean (`true` / `false`).

## [](#_define_a_boolean_attribute_type)Define a boolean attribute type

```typeql
#!test[schema]
define
  attribute shipped value boolean;
```

## [](#_insert_data_that_has_a_boolean_attribute)Insert data that has a boolean attribute

```typeql
#!test[schema]
#{{
define
  entity order, owns shipped;
#}}
#!test[write]
insert
  $o isa order, has shipped false;
```

## [](#_insert_a_standalone_boolean_attribute)Insert a standalone boolean attribute

```typeql
#!test[write]
insert
  $_ isa shipped false;
```

## [](#_specify_valid_values_for_a_boolean_attribute_type)Specify valid values for a boolean attribute type

```typeql
#!test[schema]
define
  attribute opted-in value boolean @values(true);
```

## [](#_specify_valid_values_for_owning_a_boolean_attribute_type)Specify valid values for owning a boolean attribute type

```typeql
#!test[schema]
#{{
define
  attribute email-verified value boolean;
#}}
#!test[schema]
define
  entity subscriber owns email-verified @values(true);
```

## [](#_retrieve_data_by_boolean_attribute)Retrieve data by boolean attribute

```typeql
#!test[read]
match
  $o isa order, has shipped false;
```

[Value types](../index.md) [Integer](../integer/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/typeql-reference/modules/ROOT/pages/value-types/boolean.adoc) Edit this page on GitHub.