SQL查询错误日期

时间:2018-05-25 21:28:56

标签: mysql sql

如果我要导入此查询,为什么MySQL会给我#1063 - 列'日期'错误列错误?我在该行中需要的是具有格式的日期:YYYY / MM / DD。有人可以帮我解释什么是错的,为什么这是错的,所以我可以学习:)谢谢!

CREATE TABLE Employee (
    Employee_number INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    Lastname VARCHAR (255) NOT NULL,
    Firstname VARCHAR (255) NOT NULL,
    Residence VARCHAR (255) NOT NULL,
    Skilllevel TINYINT NOT NULL,
    Salary DECIMAL NOT NULL
);
CREATE TABLE Direct_hours (
    Date DATE AUTO_INCREMENT PRIMARY KEY,
    FOREIGN KEY Employee_number INT NOT NULL REFERENCES Employee (Employee_number),
    FOREIGN KEY Project_number INT NOT NULL REFERENCES Project (Project_number)
);
CREATE TABLE Indirect_hours (
    Date DATE NOT NULL AUTO_INCREMENT PRIMARY KEY,
    FOREIGN KEY Employee_number INT NOT NULL REFERENCES Employee (Employee_number),
    Type VARCHAR (255) NOT NULL,
    Number INT NOT NULL
);
CREATE TABLE Customer (
    Customer_number INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    Client_name VARCHAR (255) NOT NULL,
    Residence VARCHAR (255) NOT NULL
);
CREATE TABLE Skilllevel (
    Levels TINYINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    FOREIGN KEY Employee_number INT NOT NULL REFERENCES Employee (Employee_number),
    Description VARCHAR (255) NOT NULL,
    Hourly_rate TINYINT NOT NULL
);
CREATE TABLE Project (
    Project_number INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
    FOREIGN KEY Employee_number INT NOT NULL REFERENCES Employee (Employee_number),
    FOREIGN KEY Customer_number INT NOT NULL REFERENCES Customer (Customer_number),
    Hourly_rate TINYINT NOT NULL
);

0 个答案:

没有答案