某城市開了一家新的電影院,吸引了很多人過來看電影,該電影院特別注意用戶體驗,專門有個 LED顯示板做電影推薦,上面公布著影評和相關電影描述,
作為該電影院的資訊部主管,您需要撰寫一個 SQL查詢,找出所有影片描述為非 boring(不無聊)的并且id 為奇數的影片,結果請按等級rating排列,

-- ----------------------------
-- Table structure for `cinema`
-- ----------------------------
DROP TABLE IF EXISTS `cinema`;
CREATE TABLE `cinema` (
`id`int(11) NOT NULL,
`movie`varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`rating` float(2,1) DEFAULT NULL,
PRIMARYKEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ----------------------------
-- Records of cinema
-- ----------------------------
INSERT INTO `cinema` VALUES ('1', 'War', 'great3D', '8.9');
INSERT INTO `cinema` VALUES ('2', 'Science','fiction', '8.5');
INSERT INTO `cinema` VALUES ('3', 'irish','boring', '6.2');
INSERT INTO `cinema` VALUES ('4', 'Ice song','Fantacy', '8.6');
INSERT INTO `cinema` VALUES ('5', 'House card','Interesting', '9.1');
select * from cinema where description <> 'boring' and MOD(id, 2) = 1
order by rating desc;
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/156115.html
標籤:其他
