> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# Schema design

What DEFINE does in SurrealDB. How to inspect what you have defined.

Almost everything structural in SurrealDB starts with `DEFINE`: namespaces, databases, tables, fields, indexes, functions, access methods, parameters, and more. The [DEFINE overview](/docs/reference/query-language/statements/define/overview.md) in the API docs shows the syntax for each statment. Each such resource also has an `ALTER` and `REMOVE` statement if you need to change or remove a definition.

## Seeing what is defined

A schema will quickly grow to the point that it is no longer possible to keep in your head. The [`INFO`](/docs/reference/query-language/statements/info.md) statement can be used to show what definitions exist. `INFO` statements can be used on a variety of resources, such as `INFO FOR DATABASE`, `INFO FOR TABLE table_name`, `INFO FOR INDEX index_name`, and so on.

```surql
DEFINE FIELD name ON TABLE person TYPE string COMMENT "Todo: add assertion for maximum length";
INFO FOR TABLE person;
```

```surql output="Response"
{
	events: {},
	fields: {
		name: "DEFINE FIELD name ON person TYPE string COMMENT 'Todo: add assertion for maximum length' PERMISSIONS FULL"
	},
	indexes: {},
	lives: {},
	tables: {}
}
```

Users and other global objects show up when you ask at database level:

```surql
DEFINE USER db_user ON DATABASE PASSWORD "strongpassword" ROLES OWNER;
DEFINE TABLE person SCHEMAFULL;
INFO FOR DB;
```

```surql output="Response"
{
	accesses: {},
	analyzers: {},
	functions: {},
	models: {},
	params: {},
	tables: {
		person: 'DEFINE TABLE person TYPE ANY SCHEMAFULL PERMISSIONS NONE'
	},
	users: {
		db_user: "DEFINE USER db_user ON DATABASE PASSHASH '[REDACTED]' ROLES OWNER"
	}
}
```

## Where to go next

* [Tables](/docs/learn/schema-management/tables-and-fields/tables.md) and [fields](/docs/learn/schema-management/tables-and-fields/fields-and-validation.md)
* [Schema best practices](/docs/learn/schema-management/schema-design/schema-best-practices.md)
* [Schema evolution](/docs/learn/schema-management/schema-design/schema-evolution.md)
* [SurrealKit schema migration](/docs/manage/schema-migration.md) - manage `.surql` schema files and apply them with sync or rollouts
