Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"year" as a Column Name in a MySQL Table

Tags:

mysql

Is it okay to name a column in a MySQL table year? Any reason not to?

like image 887
Laxmidi Avatar asked Dec 04 '25 21:12

Laxmidi


2 Answers

If you quote your identifiers properly, you can use almost any word you want:

SELECT * FROM `select` WHERE `select`.id > 100;
like image 170
nickf Avatar answered Dec 07 '25 09:12

nickf


You can name it year, there is no reason not to do so because it is not the reserved keyword of mysql/sql.

like image 41
Sarfraz Avatar answered Dec 07 '25 11:12

Sarfraz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!