CREATE TABLE problems: Invalid column name.

From SQLZoo
Jump to navigation Jump to search

CREATE TABLE problems: Invalid column name.

schema:scott

You may not use a reserved word as the name of a field. Many popular words are used by the system; some words to avoid...
date, day, index, number, order, size, year

SQL Reserved words

Having a "house-rule" can prevent such problems. Some developers

insist that field names begin with fld for example fldSurname. Most of us have enough meaningless junk in their lives already; we

don't need this kind of self imposed tyranny.

DROP TABLE t_wrong
CREATE TABLE t_wrong (when DATETIME)
CREATE TABLE t_wrong ([date] DATE)
CREATE TABLE t_wrong (date DATE)
DataWars, Data Science Practice Projects - LogoDataWars: Practice Data Science/Analysis with +100 Real Life Projects