我在数据库中有错误 [英] I have mistake in database

查看:53
本文介绍了我在数据库中有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按如下方式创建表时

create table Ticket (
ticket_id integer not null primary key,
AirlineName varchar not null,
CustomerName varchar,
fromCity varchar,
toCity varchar,
fltNo integer,
TicketDate date,
Dtime TIME,
Atime time,
price integer);

我收到以下错误:

您的SQL语法有错误;检查手册 对应于您的MySQL服务器版本以使用正确的语法 在'not null,CustomerName varchar,fromCity varchar,toCity附近 varchar,第3行的fltNo inte'

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 'not null, CustomerName varchar, fromCity varchar, toCity varchar, fltNo inte' at line 3

这可能是什么原因以及如何解决?

What might cause this and how to I solve it?

推荐答案

create table Ticket (
ticket_id INT NOT NULL primary key,
AirlineName varchar(255) not null,
CustomerName varchar(255),
fromCity varchar(255),
toCity varchar(255),
fltNo INT,
TicketDate date,
Dtime TIME,
Atime time,
price int);

这篇关于我在数据库中有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆