MySQL + SQL · Lesson 41

Comments in SQL

Why Comments?

Comments are notes inside SQL that the database ignores. They explain what a query does.

Two Styles

-- This is a single-line comment
SELECT * FROM students;  -- also works at line end

/* This is a
   multi-line comment */
SELECT name FROM students;

Summary

  • -- starts a single-line comment.
  • /* ... */ wraps a multi-line comment.
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 Live Code Editor

This page's programs are ready here — run them, edit them, and learn. No installation needed.
Powered by OneCompiler. The code loads into the editor automatically — press Run to see the output. If the editor does not open, open it in a new tab.