简体   繁体   中英

table creation query showing error

I am trying to create a table it is showing following error

#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) DEFAULT NULL' at line 6

Query is

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
) 

My questions are

1) resolution of above mentioned error

2)What more fields should I include or remove for storing video details

You're using the wrong quote character on some of your column names. You should be using the backtick (`) everywhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM