MySQL SQLLesson 45Free preview
MySQL Comments
This lesson is part of MySQL · All levels
Summary
Comment is used to write explanatory notes in SQL scripts without affecting command execution. MySQL supports single-line comments with the -- or #, as well as multi-line comments with the /*... */ pattern. Good comments help the team understand why a query was written.
Key points
- One line comment is written with -- followed by spaces or with #
- Multi-line commentary wrapped up
- Comments are ignored by MySQL when the query is executed
- Use comments to explain logical reasons, not repeat the code content
- The comment block can be used to disable some query while
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.