首页 > 数据库 >LeetCode-SQL-620. Not Boring Movies

LeetCode-SQL-620. Not Boring Movies

时间:2022-12-14 15:05:40浏览次数:55  
标签:rating 620 description cinema Boring Movies boring id +---------+-----------+---


题目

X city opened a new cinema, many people would like to go to this cinema. The cinema also gives out a poster indicating the movies’ ratings and descriptions.
Please write a SQL query to output movies with an odd numbered ID and a description that is not 'boring'. Order the result by rating.

For example, table cinema:

+---------+-----------+--------------+-----------+
| id | movie | description | rating |
+---------+-----------+--------------+-----------+
| 1 | War | great 3D | 8.9 |
| 2 | Science | fiction | 8.5 |
| 3 | irish | boring | 6.2 |
| 4 | Ice song | Fantacy | 8.6 |
| 5 | House card| Interesting| 9.1 |
+---------+-----------+--------------+-----------+
For the example above, the output should be:
+---------+-----------+--------------+-----------+
| id | movie | description | rating |
+---------+-----------+--------------+-----------+
| 5 | House card| Interesting| 9.1 |
| 1 | War | great 3D | 8.9 |
+---------+-----------+--------------+-----------+

代码

注意使用mod函数 此函数使用方法为
mod(a.b) 就相当于 a%b 相当于a除以b取余。

select * from 
cinema where
description!='boring'
and mod(id,2)=1
order by rating DESC


标签:rating,620,description,cinema,Boring,Movies,boring,id,+---------+-----------+---
From: https://blog.51cto.com/u_12938555/5936982

相关文章

  • TMC4671+TMC6200---Trinamic直流无刷(BLDC)硬件FOC解决方案
    1、正压呼吸机解决方案呼吸机的通气舒适度及静音性能是其重要指标。另外,睡眠呼吸机的功能之一是在系统发生异常时,能及时发现并立即采取适合的保护措施,其核心要点即是呼吸......
  • 20220620 DispatcherServlet 处理请求
    概述DispatcherServlet的继承关系DispatcherServlet初始化触发初始化时机处理第一个请求时需要初始化这里执行的是servlet.init方法,也就是Servlet初始化生命周......
  • MBR16200CT-ASEMI插件肖特基二极管MBR16200CT
    编辑-ZMBR16200CT在TO-220AB封装里采用的2个芯片,其尺寸都是102MIL,是一款插件肖特基二极管。MBR16200CT的浪涌电流Ifsm为200A,漏电流(Ir)为0.05mA,其工作时耐温度范围为-65~175......
  • MBR16200CT-ASEMI插件肖特基二极管MBR16200CT
    编辑-ZMBR16200CT在TO-220AB封装里采用的2个芯片,其尺寸都是102MIL,是一款插件肖特基二极管。MBR16200CT的浪涌电流Ifsm为200A,漏电流(Ir)为0.05mA,其工作时耐温度范围为-65~1......
  • MBR16200FCT-ASEMI塑封肖特基二极管MBR16200FCT
    编辑:llMBR16200FCT-ASEMI塑封肖特基二极管MBR16200FCT型号:MBR16200FCT品牌:ASEMI封装:ITO-220AB正向电流:16A反向电压:200V引线数量:3芯片个数:2芯片尺寸:102MIL漏电流:10ua恢复时间......
  • MBR16200FCT-ASEMI塑封肖特基二极管MBR16200FCT
    编辑:llMBR16200FCT-ASEMI塑封肖特基二极管MBR16200FCT型号:MBR16200FCT品牌:ASEMI封装:ITO-220AB正向电流:16A反向电压:200V引线数量:3芯片个数:2芯片尺寸:102MIL漏电流:1......
  • MBR16200CT-ASEMI半塑封肖特基二极管MBR16200CT
    编辑:llMBR16200CT-ASEMI半塑封肖特基二极管MBR16200CT型号:MBR16200CT品牌:ASEMI封装:TO-220AB特性:肖特基二极管正向电流:16A反向耐压:200V恢复时间:5ns引脚数量:3芯片......
  • HDU 3518 Boring counting
    Description035nowfacedatoughproblem,hisenglishteachergiveshimastring,whichconsistswithnlowercaseletter,hemustfigureouthowmanysub......
  • MBR16200FCT-ASEMI大功率肖特基二极管MBR16200FCT
    编辑-ZMBR16200FCT在ITO-220AB封装里采用的2个芯片,其尺寸都是102MIL,是一款大功率肖特基二极管。MBR16200FCT的浪涌电流Ifsm为200A,漏电流(Ir)为0.05mA,其工作时耐温度范围为-6......
  • ASEMI肖特基二极管MBR16200CT图片,MBR16200CT应用
    编辑-ZASEMI肖特基二极管MBR16200CT参数:型号:MBR16200CT最大重复峰值反向电压(VRRM):200V最大RMS电桥输入电压(VRMS):140V最大直流阻断电压(VDC):200V最大平均正向整流输出电流(IF):16A峰......