# Easy way to define new attributes to entity after initial schema definition

**URL:** <https://forum.typedb.com/t/easy-way-to-define-new-attributes-to-entity-after-initial-schema-definition/287>\
**Category:** TypeQL\
**Created:** [19 January 2023 00:21 UTC](https://forum.typedb.com/t/easy-way-to-define-new-attributes-to-entity-after-initial-schema-definition/287 "2023-01-19T00:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alan\_wu](https://avatars.discourse-cdn.com/v4/letter/a/6bbea6/32.png) [@alan\_wu](https://forum.typedb.com/u/alan_wu)\
**Post date:** [19 January 2023 00:21 UTC](https://forum.typedb.com/t/easy-way-to-define-new-attributes-to-entity-after-initial-schema-definition/287/1 "2023-01-19T00:21:39Z")

</div>

Hi,

In SQL, we can “_ALTER TABLE my\_table ADD new\_column varchar;_” to add a new column to an existing table. Can we do the similar in TypeDB? After initially defining the schema, I realised I wanted to define a new attribute to an entity type. I chekced the documentation and there was no obvious solution. There is ‘define’ and ‘undefine’, wondering if there can be an ‘alter’ as well.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![james.williams](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.typedb.com/james.williams/32/49_2.png) [@james.williams](https://forum.typedb.com/u/james.williams)\
**Post date:** [19 January 2023 08:52 UTC](https://forum.typedb.com/t/easy-way-to-define-new-attributes-to-entity-after-initial-schema-definition/287/2 "2023-01-19T08:52:59Z")

</div>

Hi Alan,

You can use `define` again to add more attributes to an entity type. Here’s an example:

We initially define a person with a first name.

```auto
define 
    first-name sub attribute, value string;
    
    person sub entity, owns first-name;

```

Following this, we might decide we also want to people to have last names as well.

```auto
define
    last-name sub attribute, value string;
    
    person sub entity, owns last-name;

```

Now, our `person` entity has both a `first-name` and a `last-name`.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/vaticle/original/1X/d9ebebdde5b255906d4a0ed06f2bdf75bcca78f0.png)

I agree with you that the documentation surrounding the semantics of using `define` like this could use improvement. I’ve filed an issue with our docs to ensure that this gets addressed.
