 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can create a table having the name like a^b along with same column name?\\nname?
For creating a table with such kinds of names we must have to use quote character. The quotes can be single or double depends upon ANSI_QUOTES SQL mode.
If this mode is disabled then the identifier quote character is the backtick (“`”). Consider the following example in which we created a table named ‘select’ −
mysql> Create table `a^b`(`a^b` int); Query OK, 0 rows affected (0.19 sec) mysql> Create table "a^g"("a^g" int); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"a^g" ("a^g" int)' at line 1 If this mode is enabled then we can use backtick (“`”) and double quotes (“”) both as a quote character. Consider the following example in which we created the table like the above name with the help of both quote characters after enabling this mode −
mysql> Set sql_mode = 'ANSI_Quotes'; Query OK, 0 rows affected (0.03 sec) mysql> Create table "a^d"("a^d" int); Query OK, 0 rows affected (0.21 sec) mysql> Create table `a^e`(`a^e` int); Query OK, 0 rows affected (0.14 sec)Advertisements
 