- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Placing comments in the middle of a create table statement? Is it possible?
Yes, it is possible using the # symbol. Let us first create a table −
mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY , # Creating a sequence Number -> FirstName varchar(20), # Creating a column to store name -> Age int # creating a column to store an age -> ); Query OK, 0 rows affected (1.43 sec)
Above, we have set comments using the # symbol. Insert some records in the table using insert command. We will set comments in insert statement as well using the same # symbol −
mysql> insert into DemoTable(FirstName,Age) values('Chris',21); Query OK, 1 row affected (0.54 sec) mysql> insert into DemoTable(FirstName,Age) values('David',23); # Inserting to store Firstname and age. Query OK, 1 row affected (0.42 sec) mysql> insert into DemoTable(FirstName,Age) values('Bob',24); # Inserting to store Firstname and age. Query OK, 1 row affected (0.30 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable;
This will produce the following output −
+----+-----------+------+ | Id | FirstName | Age | +----+-----------+------+ | 1 | Chris | 21 | | 2 | David | 23 | | 3 | Bob | 24 | +----+-----------+------+ 3 rows in set (0.00 sec)
- Related Articles
- Is it possible to create a new data type in JavaScript?
- How to create a temporary MySQL table in a SELECT statement without a separate CREATE TABLE?
- Is it possible to create static constructor in java?
- Is it possible to create a class without a name in Java?
- How can I see the CREATE TABLE statement of an existing MySQL table?
- How can we discard a MySQL statement in the middle of its processing?
- Is it possible to have View and table with the same name in MySQL?
- Is it possible to create a custom exception in java without extending Exception class?
- Check if it is possible to create a polygon with a given angle in Python
- Would you cool a bucket of water more quickly by placing it on ice or by placing ice in it? Give reasons for your answer.
- Using CREATE TABLE AS statement with UNION of two tables in MySQL
- Check if it is possible to create a palindrome string from given N in Python
- Check if it is possible to create a polygon with given n sidess in Python
- Insert the results of a MySQL select? Is it possible?
- How can we put comments in a column of existing MySQL table?

Advertisements