MariaDB Comments


Objectives

  • Why need MariaDB Comments

  • MariaDB Single Line Comments

  • MariaDB Multi-line Comments


Why need MariaDB Comments

Comments are used to explain SQL statements. You may think why need comment for explain SQL right? There is various reason

  • For explain long SQL statements.

  • When single file has multiple SQL statements, then can use for separation.

  • Use for SQL documentation.

  • Note for prerequisite or safety. etc.


MariaDB Single Line Comments

-- This is single line comment which ignore by database
SELECT * FROM person;
Here
  • Single line comment start with --.

  • After -- everything ignored by database engine.


MariaDB Multi-line Comments

/*
This is multi line comment
You can write documentation or various note here
*/
SELECT * FROM person;
Here
  • Multi line comment start with /* and ends with */

  • Inside of /* */ everything ignored by database engine.


MariaDB Comments Video tutorial