# Create statement · Chromia Docs (concept)

> Must specify all attributes that don't have default values:

Source: https://docs.chromia.com/rell/language-features/database/create/

# Create statement

Must specify all attributes that don't have default values:

Rell

```
create user(name = 'Bob', company = company @ { .name == 'Amazon' });
```

You don't need to specify the attribute name if it's matched by name or type:

Rell

```
val name = 'Bob';
create user(name, company @ { company.name == 'Amazon' });
```

Can use the created object:

Rell

```
val new_company = create company(name = 'Amazon');
val new_user = create user(name = 'Bob', new_company);
print('Created new user:', new_user);
```

Inserting multiple records:

A new variant of the "create" expression allows for the insertion of multiple database records with a single SQL
statement, improving efficiency compared to inserting records one by one. It accepts a list of structs representing
records of a specific type. If the list is empty, no SQL statement is executed. The expression returns a list of the
inserted entities, maintaining the same size and order as the input list.

Rell

```
create MyEntity(list<struct<MyEntity>>): list<MyEntity>;
```

[View this page on docs.chromia.com](https://docs.chromia.com/rell/language-features/database/create/)Content mirrored from the live docs
