Comments in SQL

To clarify some instructions, we sometimes need to add comments.


It is possible to enter comments on the command line, that is, a text that is not executed; For this, two hyphens (-) are used:


 select * from books; - show the book records 

in the previous line, everything after the hyphens (to the right) is not executed.


To add multiple lines of comments, a slash followed by an asterisk (/ *) is placed at the beginning of the comment block and at the end of it, an asterisk followed by a slash (* /)


 select title, author 

 / * we show titles and

 authors' names * /

 from books;

everything between the "/ *" and "* /" symbols is not executed.

Comments

Popular posts from this blog

Data Consistency and Inconsistency - What is Difference

Cardinality in DBMS – max/minimum cardinality & examples

Relational Model in DBMS