'MySql gives an error for no reason at all? [duplicate]
I am writing an mysql program (using the command line editor):
CREATE TABLE FLIGHTS (
FL_NO VARCHAR(10) NOT NULL PRIMARY KEY,
STARTING VARCHAR(20) NOT NULL,
ENDING VARCHAR(20) NOT NULL,
NO_FLIGTHS INT NOT NULL,
NO_STOPS INT NOT NULL
);
this is somehow gives an error which is surprising. any idea?
Error message: 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 'STARTING VARCHAR(20) NOT NULL, ENDING VARCHAR(20) NOT NULL, NO_FLIGHTS INTEGER N' at line 3
Solution 1:[1]
STARTING and ENDING are keywords, and MySql does not accept keywords as column names, changing them should help...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | 11 B 210109 GATHIK JINDAL |
