# AML Model > The AML Model block maps a database table or SQL query to dimensions and measures, giving Holistics the structure it needs to explore and aggregate your data. ## Introduction A Model in AML represents either a database table or a SQL query, and contains dimensions and measures that define how data can be explored and aggregated. Models are declared in `.model.aml` files (one model per file). ## Model types AML supports two types of models: - **[Table Model](/reference/aml/table-model)**: Built on top of a physical database table - **[Query Model](/reference/aml/query-model)**: Built on top of a custom SQL query ## Common parameters These parameters are shared by both Table Models and Query Models: Parameter name | Description -------------- | ------------ type | Model type: `'table'` for Table Model, `'query'` for Query Model label | User-friendly name for the model that appears in the Dataset exploration UI description | Description of the model. Support Markdown. data_source_name | The database on which Holistics will execute the SQL generated from this model owner | Define who should be in charge of managing the current model dimension | Define a dimension. See [Model Fields](/reference/aml/field) measure | Define a measure. See [Model Fields](/reference/aml/field) ## Basic syntax ```aml Model model_name { type: 'table' // or 'query' label: "Model Label" description: "Model description here" data_source_name: 'your_datasource_name' owner: 'user@your-domain.com' dimension dimension_name { label: 'Dimension Label' type: 'text' definition: @sql {{ #SOURCE.column_name }};; } measure measure_name { label: 'Measure Label' type: 'number' definition: @aql count(model_name.dimension_name) ;; } } ``` ## See also - [Table Model](/reference/aml/table-model) - [Query Model](/reference/aml/query-model) - [Model Fields](/reference/aml/field)