SQL Comments

SQL comments are used to explain and clarify the code, making it easier to understand for anyone reading it later. […]

SQL comments are used to explain and clarify the code, making it easier to understand for anyone reading it later. Comments are not executed as part of the SQL statement.

SQL Comments Syntax

In SQL, there are two types of comments: single-line and multi-line.

Tutorials dojo strip
  • Single-line comment: Begins with --
  • Multi-line comment: Enclosed between /* and */



SQL Comments Example

SQL Comments Single line Comments

Single-line comments are useful for adding brief explanations or notes directly above a line of code. They are ideal for quick notes or reminders.

SQL




SQL Comments Multi-line Comments

Multi-line comments allow you to provide more detailed explanations that span several lines. They can be helpful when you need to describe complex logic or provide context for a section of code.

SQL




SQL Comments Labs

Tutorials dojo strip