---
metadata:
  - name: generator
    content: Diplodoc Platform v5.59.0
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/alter_table/not_null.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/alter_table/not_null.md
  - href: https://ydb.tech/docs/en/yql/reference/syntax/alter_table/not_null.md
    type: text/markdown
    title: Markdown version
  - href: https://ydb.tech/docs/en/llms.txt
    rel: describedby
sourcePath: en/core/yql/reference/syntax/alter_table/not_null.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Changing the `NOT NULL` constraint

The `NOT NULL` constraint is a column-level data integrity constraint that prohibits writing `NULL` values. It ensures that the column always contains a valid value.


## Dropping `NOT NULL`

`DROP NOT NULL` removes the `NOT NULL` constraint from the specified column.

For example, the following query will remove the `NOT NULL` constraint from column `column_name` in table `table_name`:


```yql
ALTER TABLE table_name ALTER COLUMN column_name DROP NOT NULL;
```


`DROP NOT NULL` can be applied to non-key columns in both row-oriented and column-oriented tables.

## See also

* [ALTER COLUMN](https://ydb.tech/docs/en/yql/reference/syntax/alter_table/columns.md)
