tags:

views:

31

answers:

4

Hi,

I've got an easy question. Is it okay to name a column in a mysql table 'year'? Any reason not to?

Thanks,

-Laxmidi

+2  A: 

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

Sarfraz
Thanks for the help. Sarfraz!-Laxmidi
Laxmidi
@Laxmidi: You are welcome :)
Sarfraz
A: 

Check the MySQL Keywords list if you're ever curious.

statenjason
statenjason, thanks for the info. I'll use the list in the future. -Laxmidi
Laxmidi
A: 

It's not one of the reserved words, so it should be fine.

Dominic Barnes
Thanks, Dominic.-Laxmidi
Laxmidi
+3  A: 

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

SELECT * FROM `select` WHERE `select`.id > 100;
nickf