# Integer

A 64-bit signed integer.

## [](#_define_an_integer_attribute_type)Define an integer attribute type

```typeql
#!test[schema]
define
  attribute total-likes value integer;
```

## [](#_insert_data_that_has_an_integer_attribute)Insert data that has an integer attribute

```typeql
#!test[schema]
#{{
define
  entity post, owns total-likes;
#}}
#!test[write]
insert
  $p isa post, has total-likes 42;
```

## [](#_insert_a_standalone_integer_attribute)Insert a standalone integer attribute

```typeql
#!test[write]
insert
  $_ isa total-likes 42;
```

## [](#_specify_valid_values_for_an_integer_attribute_type)Specify valid values for an integer attribute type

```typeql
#!test[schema]
define
  attribute star-rating value integer @values(1, 2, 3, 4, 5);
```

## [](#_specify_valid_values_for_owning_an_integer_attribute_type)Specify valid values for owning an integer attribute type

```typeql
#!test[schema]
define
  entity review owns star-rating @values(1, 3, 5);
```

## [](#_specify_range_of_valid_values_for_an_integer_attribute_type)Specify range of valid values for an integer attribute type

```typeql
#!test[schema]
define
  attribute publication-year value integer @range(1900..2100);
```

## [](#_specify_range_of_valid_values_for_owning_an_integer_attribute_type)Specify range of valid values for owning an integer attribute type

```typeql
#!test[schema]
define
  entity book owns publication-year @range(2000..2100);
```

## [](#_retrieve_data_by_integer_attribute)Retrieve data by integer attribute

```typeql
#!test[read]
match
  $p isa post, has total-likes 42;
```

[Boolean](../boolean/index.md) [Double](../double/index.md)

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