SQL COMMENT Statements

SQL Comments are used to explain sections of statements OR to prevent execution of SQL statements. SQL Comments are not supported in Microsoft Access databases; thus use Firefox and Microsoft Edge.

Types of SQL Comments

  • Single Line Comments
  • Multi-Line Comments
  • SQL Comment Indicator

Single Line Comments

Single Line Comments are start with -- symbol.

Comments Syntax Symbol

-- Commented Line of code Here

Example of Single Line Comment

-- SELECT * FROM CUSTOMERS;
SELECT CUSTOMER_NAME, CITY, COUNTRY
FROM CUSTOMERS;

Multi-Line Comments

  • Multi-Line Comments start with /* and end */ Symbol/
  • Type any line of codes between start /* and end */ of symbol
  • And the browser will be ignored all line of codes between those symbol.

Comments Syntax Using (/* */) Symbol

/* Commented Multi-Line 
of code Here */

Example of Multi-Line Comment

/* SELECT CUSTOMER_NAME, CITY 
FROM CUSTOMERS
WHERE COUNTRY = "UK"; */

SELECT CUSTOMER_NAME, CITY, COUNTRY
FROM CUSTOMERS;

Email Us: advertise@gdatamart.com

Donate Us: Support to GDATAMART

© 2023 GDATAMART.COM (All Rights Reserved)