Link to home
Create AccountLog in
Avatar of Momoftwo
Momoftwo

asked on

How to edit existing database in MYSQL in order to add comments.

Hello. Created my first database with tables and columns for my mysql class, then Applied. Now realize I was supposed to include comments "at the top of the file" to include my name, class name and assignment number.

How can I go back in and add comments? Tried Update in command line, and looked around in Workbench, to no avail.

I guess a basic question is, can there be comments at the top of a MYSQL database?

Please advise. Thank you.
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

to add a comment to a column to the table:
ALTER TABLE <table> COMMENT = 'blah blah blah';

to a column:
ALTER TABLE <table> CHANGE <columns> <data type> COMMENT 'xxxxx';

this should do it...
Avatar of Momoftwo
Momoftwo

ASKER

Are those comments for the benefit of the programmer like they are in Python or VB?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
The expert told me how to add comments and also that most developers don't use comments. That's all I needed to know! Thank  you.