# Reference

Learn three components, and you know Gel: how to work with [schema](https://docs.geldata.com/reference/datamodel.md#ref-datamodel-index), how to write queries with [EdgeQL](https://docs.geldata.com/reference/edgeql.md#ref-edgeql), and what's available to you in our [standard library](https://docs.geldata.com/reference/stdlib.md#ref-std). Start in those sections if you're new to Gel. Move over to our [reference](https://docs.geldata.com/reference/reference.md#ref-reference-index) when you're ready to dive deep into the internals, syntax, and other advanced topics.

## Schema

Gel schemas are declared using our schema definition language (SDL).

```sdl
module default {
  type Book {
    required title: str;
    release_year: int16;
    author: Person;
  }
  type Person {
    required name: str;
  }
}
```

The example schema above defines two types: Book and Person, each with a property or two. Book also contains a link to the author, which is a link to objects of the Person type. Learn more about how to define your schema using SDL in the [schema](https://docs.geldata.com/reference/datamodel.md#ref-datamodel-index) section.

## EdgeQL

EdgeQL is a next-generation query language designed to match SQL in power and surpass it in terms of clarity, brevity, and intuitiveness.

```edgeql-repl
db> select Book {
...   title,
...   release_year,
...   author: {
...     name
...   }
... } order by .title;
{
  default::Book {
    title: '1984',
    release_year: 1949,
    author: default::Person {
      name: 'George Orwell'
    }
  },
  default::Book {
    title: 'Americanah',
    release_year: 2013,
    author: default::Person {
      name: 'Chimamanda Ngozi Adichie'
    }
  },
  ...
}
```

You can use EdgeQL to easily return nested data structures just by putting a shape with a link on an object as shown above.

## Standard library

Gel comes with a rigorously defined type system consisting of scalar types, collection types (like arrays and tuples), and object types. It also includes a library of built-in functions and operators for working with each datatype, alongside some additional utilities and extensions.

```edgeql-repl
db> select count(Book);
{16}
db> select Book {
...   title,
...   title_length := len(.title)
... } order by .title_length;
{
  default::Book {
    title: 'Sula',
    title_length: 4
  },
  default::Book {
    title: '1984',
    title_length: 4
  },
  default::Book {
    title: 'Beloved',
    title_length: 7
  },
  default::Book {
    title: 'The Fellowship of the Ring',
    title_length: 26
  },
  default::Book {
    title: 'One Hundred Years of Solitude',
    title_length: 29
  },
}
db> select math::stddev(len(Book.title));
{7.298401651503339}
```

Gel comes with a rigorously defined type system consisting of scalar types, collection types (like arrays and tuples), and object types. It also includes a library of built-in functions and operators for working with each datatype, alongside some additional utilities and extensions.

## Cheatsheets

Learn to do various common tasks using the many tools included with Gel.

### Querying

- [Select](https://docs.geldata.com/resources/cheatsheets/select.md#ref-cheatsheet-select)
- [Insert](https://docs.geldata.com/resources/cheatsheets/insert.md#ref-cheatsheet-insert)
- [Update](https://docs.geldata.com/resources/cheatsheets/update.md#ref-cheatsheet-update)
- [Delete](https://docs.geldata.com/resources/cheatsheets/delete.md#ref-cheatsheet-delete)
- [via GraphQL](https://docs.geldata.com/reference/using/graphql/cheatsheet.md#ref-cheatsheet-graphql)

### Schema

- [Booleans](https://docs.geldata.com/resources/cheatsheets/boolean.md#ref-cheatsheet-boolean)
- [Object Types](https://docs.geldata.com/resources/cheatsheets/objects.md#ref-cheatsheet-object-types)
- [Functions](https://docs.geldata.com/resources/cheatsheets/functions.md#ref-cheatsheet-functions)
- [Aliases](https://docs.geldata.com/resources/cheatsheets/aliases.md#ref-cheatsheet-aliases)
- [Annotations](https://docs.geldata.com/resources/cheatsheets/annotations.md#ref-cheatsheet-annotations)
- [Link Properties](https://docs.geldata.com/reference/datamodel/linkprops.md#ref-datamodel-linkprops)

### Admin

- [CLI](https://docs.geldata.com/resources/cheatsheets/cli.md#ref-cheatsheet-cli)
- [REPL](https://docs.geldata.com/resources/cheatsheets/select.md#ref-cheatsheet-select)
- [Admin](https://docs.geldata.com/resources/cheatsheets/admin.md#ref-cheatsheet-admin)

