MySQL-Home MySQL-Environment setup MySQL- Workbench MySQL-Basic syntax MySQL-Operator MySQL-Data type MySQL-Comments MySQL-Create DB MySQL-Drop DB MySQL-Select DB MySQL-Create Table MySQL-Drop table MySQL-Truncate MySQL-Primary Key MySQL-Foreign Key MySQL-Null MySQL-Increment MySQL-Having MySQL-Top MySQL-Insert Statement MySQL-Select Statement MySQL-Alter Statement MySQL-Where MySQL-And & Or MySQL-Default values MySQL-Exists MySQL-Order by MySQL-View MySQL-Update Statement MySQL-Delete Statement MySQL-Like MySQL-Sort MySQL-Limit MySQL-Min MySQL-Max MySQL-Group MySQL-In MySQL-Between MySQL-Union MySQL-Count MySQL-Average MySQL-Sum MySQL-Date & Time MySQL-Import MySQL-Export MySQL-Index MySQL-Temporary MySQL-Join MySQL-Full Join MySQL-Inner Join MySQL-Left Join MySQL-Right Join MySQL-Store Procedure MySQL-Injection MySQL-PHP connection

MySQL - Comments

Comments are a piece of code which is ignored in execution

Comments allows developers to leave notes about their code

It is a good practice to add comments into your MySQL code, especially in complex documents

Single Line Comments

Single line comments start with --.

Any text between -- and the end of the line will be ignored (will not be executed).

Example : Single Line Comments

--Select all:
SELECT * FROM Students;

SELECT * FROM Students -- WHERE ROLL_NO='Berlin';

--SELECT * FROM Students;
SELECT * FROM Students;

Multi-line Comments

Multi-line comments start with /* and end with */.

Any text between /* and */ will be ignored.

Example : Multi-line Comments

 /*Select all the columns
of all the records
in the Students table:*/
SELECT * FROM Students;

/*SELECT * FROM Students;
SELECT * FROM Students;
SELECT * FROM Students;*/
SELECT * FROM Students;