# Create relationship

CREATE RELATIONSHIP specifies new tables and columns relationship in a Direct Query application data model.

CREATE RELATIONSHIP can only be used in a Direct Query application. It must be preceded by a section directquery section.

Syntax:

CREATE RELATIONSHIP (OUTER|INNER) JOINED] TableName, [(OUTER|INNER) JOINED] TableName ON ConditionExpression ;

Information note

If an outer|inner joined qualifier for a table is not specified then the default will be inner joined.

Information note

For TableName, you can use quoted name name references. For example, `( IDENTIFIER | LITERAL_STRING | LITERAL_FIELD | LITERAL_NUMBER))`.

Examples:

```
CREATE RELATIONSHIP BETWEEN T1,T2 ON A = C;
```

```
CREATE RELATIONSHIPBETWEEN OUTER JOINED T2, INNER JOINED T3ON (D = E or (D is null and E is null));
```