हम MySQL में # सिंबल की मदद से कमेंट्स जोड़ सकते हैं। जब भी हम किसी सेंटेंस से पहले # सिंबल लिखते हैं, तो पूरी लाइन को MySQL इग्नोर कर देता है।
MySQL तीन प्रकार के कमेंट्स सपोर्ट करता है −
1. # सिंबल की मदद से
mysql> create table CommentDemo -> ( -> id int #Id is an integer type -> ); Query OK, 0 rows affected (0.65 sec)
ऊपर, हमने कमेंट सेट किया है
#Id is an integer type
2. -- सिंबल की मदद से
mysql> create table CommentDemo2 -> ( -> id int -- id is an integer type -> ); Query OK, 0 rows affected (0.49 sec)
ऊपर, हमने कमेंट सेट किया है −
-- id is an integer type
3. /* */ सिंबल की मदद से
यह मल्टीपल लाइन कमेंट्स के लिए है, C या C++ भाषा की तरह।
mysql> create table CommentDemo3 -> ( -> /*id is an integer type */ -> id int -> ); Query OK, 0 rows affected (0.52 sec)
ऊपर, हमने मल्टी-लाइन कमेंट सेट किया है
/*id is an integer type */