---
title: "Comments"
description: "How to write comments in CoraDB SQL: line comments with -- and //, block comments with /* */, and the /*+ */ form used for optimizer hints."
url: "https://www.coradb.ai/manual/sql/comment.html"
markdown_url: "https://www.coradb.ai/manual/markdown/sql/comment.md"
product: "CoraDB"
version: "1.0"
keywords: "sql comment, coradb comment, line comment, block comment, -- comment, // comment, /* */ comment, sql hint comment"
---

# Comments

CoraDB ignores comments when it runs a statement. Three styles are available, and they can be mixed in one statement:

| Style | Syntax | Extends |
|---|---|---|
| SQL | `-- comment` | To the end of the line |
| C++ | `// comment` | To the end of the line |
| C | `/* comment */` | To the closing `*/`, across lines if needed |

```sql
SELECT name            -- SQL-style comment
FROM countries         // C++-style comment
WHERE /* C-style comment */ code = 'FRA';
```

| name |
|---|
| France |

A C-style comment can span several lines:

```sql
/* Countries we ship to.
   Codes follow ISO 3166-1 alpha-3. */
SELECT code, name FROM countries;
```

C-style comments do not nest: the first `*/` ends the comment, whatever `/*` appeared before it.

## Hints

A C-style comment that starts with a plus sign, `/*+ ... */`, is not ignored: it holds [optimizer hints](https://www.coradb.ai/manual/sql/tuning_hints.html#using-sql-hint) for the statement, such as `USE_IDX` or `ORDERED`. Write ordinary comments without the `+`.

```sql
SELECT /*+ RECOMPILE */ COUNT(*) FROM orders WHERE order_date >= DATE'2025-12-01';
```

## See also

- [Identifiers](https://www.coradb.ai/manual/sql/identifier.html)
- [Using SQL hints](https://www.coradb.ai/manual/sql/tuning_hints.html#using-sql-hint)
