Is 'desc' a valid name for a column in mysql? If I try to create a table called test with one column, it works:
mysql&gt; create table test(surname VARCHAR(300));
Query OK, 0 rows affected (0.02 sec)

mysql&gt; drop table test;
Query OK, 0 rows affected (0.00 sec)

But if I try now to create the same table, but this time the column is called 'desc' instead of 'surname', I get an error:
mysql&gt; create table test(desc VARCHAR(300));
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 'desc VARCHAR(300))' at line 1
mysql&gt; 


What am I getting wrong here? Is 'desc' a reserved keyword in mysql?
&quot;ASC&quot; or &quot;DESC&quot; are the reserved keyword in MySQL. you can't use it for column name. &quot;ASC/DESC&quot; is the keyword used to sort result sets in either ascending or descending order. &quot;ASC&quot; is used as the default.