我在運行sql數據庫時遇到了問題,我想創建一個類似於數據庫的youtube。我有這個錯誤。Sql開發人員錯誤,無效字符。創建Youtube數據庫
CREATE TABLE `Like` ( `video_id` int(5) NOT NULL DEFAULT '0', `customer_id` int(6) NOT NULL DEFAULT '0', `rating` int(1) NOT NULL DEFAULT '0', `date` date NOT NULL DEFAULT '0000-00-00', PRIMARY KEY (`video_id`,`customer_id`), KEY `date` (`date`), KEY `video_id` (`video_id`), KEY `customer_id` (`customer_id`), KEY `rating` (`rating`)) ENGINE=MyISAM DEFAULT CHARSET=latin1
Error report -
SQL Error: ORA-00911: invalid character
00911. 00000 - "invalid character"'
*Cause: identifiers may not start with any ASCII character other than
letters and numbers. $#_ are also allowed after the first
character. Identifiers enclosed by doublequotes may contain
any character other than a doublequote. Alternative quotes
(q'#...#') cannot use spaces, tabs, or carriage returns as
delimiters. For all other contexts, consult the SQL Language
Reference Manual.
*Action:
CREATE TABLE `movies` ( `id` int(5) NOT NULL DEFAULT '0', `year` int(4) DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `Channel` ( `movie_id` int(5) NOT NULL DEFAULT '0', `customer_id` int(6) NOT NULL DEFAULT '0', KEY `movie_id` (`movie_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `qualifying` ( `customer_id` int(6) NOT NULL DEFAULT '0', `date` date NOT NULL DEFAULT '0000-00-00', `movie_id` int(5) NOT NULL DEFAULT '0', KEY `movie_id` (`movie_id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE TABLE `Like` ( `video_id` int(5) NOT NULL DEFAULT '0', `customer_id` int(6) NOT NULL DEFAULT '0', `rating` int(1) NOT NULL DEFAULT '0', `date` date NOT NULL DEFAULT '0000-00-00', PRIMARY KEY (`video_id`,`customer_id`), KEY `date` (`date`), KEY `video_id` (`video_id`), KEY `customer_id` (`customer_id`), KEY `rating` (`rating`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
相當於不使用'INT(1)'等使用'int'代替。 –
您的標籤指示Oracle數據庫,但您發佈的腳本看起來像MySQL。這是什麼? – sstan
@sstan其MySQL我認爲。 –