表创建查询显示错误

时间:2013-11-08 03:40:15

标签: mysql sql

我正在尝试创建一个显示以下错误的表

#1064 - 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 ''duration' bigint (10) DEFAULT NULL,

'small_img'varchar(100)第6行的DEFAULT NULL'

查询

CREATE TABLE videos_description(
 `video_id` bigint(200) NOT NULL AUTO_INCREMENT,
 `video_path` varchar(200) NOT NULL ,
 `video_title` varchar(200) NOT NULL ,
 `description` text  DEFAULT NULL,
 'duration'    bigint (10) DEFAULT NULL,
 'small_img'  varchar(100) DEFAULT NULL,
 'large_img'  varchar(100) DEFAULT NULL,
 `source_site` varchar(100)  DEFAULT NULL,
 `sent_by` int(20) DEFAULT NULL,
 `received_by` int(20) DEFAULT NULL,
 `message_id` bigint(200) DEFAULT NULL,
 `visibility` varchar(30) DEFAULT NULL,
 `adddate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY (video_id),
  FOREIGN KEY (`received_by`) REFERENCES `users` (`userid`) ON UPDATE CASCADE,
  FOREIGN KEY (`sent_by`) REFERENCES `users` (`userid`) ON UPDATE CASCADE,
  FOREIGN KEY (`message_id`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE ON UPDATE CASCADE
) 

我的问题是

1)解决上述错误

2)我应该包含或删除哪些字段来存储视频详细信息

1 个答案:

答案 0 :(得分:1)

您在某些列名称上使用了错误的引号字符。你应该到处使用反引号(`)。