What are SQL comments?
Answers (2)Add Answer
There are three types of comments, which are given below:
- Single line comments.
- Multi-line comments
- Inline comments
Single Line Comment
-- single-line comment
/* multi-line comment another comment */ SELECT * FROM Customers;
Multi line comment -> /* SELECT * FROM Teachers; SELECT * FROM Teacher_DETAILS; SELECT * FROM Orders; */ SELECT * FROM Course;
Comments in SQL queries are viewable by programmers and serve as explanations or annotations. It’s used to help humans understand SQL statements. It will be disregarded during SQL code parsing. Comments can be written on a single line or spread out over multiple lines.
It begins with two consecutive hyphens on a single line (—).
It starts with / and finishes with / for multi-line comments.