SQL COMMENTS - The Coding Shala

Home >> Learn SQL >> SQL Comments

SQL COMMENTS

SQL Comments are added for the purpose of making the source code more readable for the programmers. Comments are not executed, they are just for explanation. In SQL, there is two type of comments - Single line comments and multi-line comments.
SQL COMMENTS - The Coding Shala

Single-Line Comments

Single line comments start with '--' so any text between -- and the end of the line will not be executed. The following example uses a single line comment - 

 -- this is single line comment  
 select * from emp --this is also single line comment;  

Multi-Line Comments

Multi-line comments start with '/*' and end with '*/' so any text between /* and */ will be skipped. The following example uses multi-line comments -  

/* this is multiple line comment  
 this is also in multi-line comment   
 end of multi-line comment */  
 select * from emp --this is single line comment; 



Other Posts You May Like
Please leave a comment below if you like this post or found some error, it will help me to improve my content.

Comments

Popular Posts from this Blog

Java Program to Convert Binary to Decimal - The Coding Shala

N-th Tribonacci Number Solution - The Coding Shala

Shell Script to Create a Simple Calculator - The Coding Shala

Shell Script to find sum, product and average of given numbers - The Coding Shala

Java Program to Convert Decimal to Binary - The Coding Shala