CREATE TABLE problems: Invalid column name.

From SQLZOO
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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)