当前位置:网站首页>True question of MySQL interview (29) -- case - finding favorite movies
True question of MySQL interview (29) -- case - finding favorite movies
2022-06-23 05:41:00 【Socialphobia_ FOGO】
Find your favorite movies
A movie platform ( It's like Douban 、 The cat's eye film ) use 3 A table to record movie information .
“ Movie list ” In is the movie number 、 The movie name 、 Movie description information .
“ Category table ” It's movie classification information , Categories include : Crime movies 、 love film 、 Science fiction film .
“ Movie category table ” It's the corresponding movie ( The movie number in the movie table ) What kind of ( Movie category number in the category table )
lookup “ Movie list ” The movie description information contains “ robot ” In the movie , Find out the corresponding movie category name and the number of movies , It is also required that the film category name corresponds to the number of films >=5 Ministry .
SELECT
Movie category name ,
COUNT(*) AS Number of films
FROM
Movie list
LEFT JOIN Movie category table USING ( Movie number )
LEFT JOIN Category table USING ( Movie category number )
WHERE Movie description information LIKE '% robot %'
GROUP BY Movie category name
HAVING Movie category name IN
(SELECT
Movie category name
FROM
Movie category table
JOIN Category table USING ( Movie category number )
GROUP BY Movie category name
HAVING COUNT(*) >= 5)
give the result as follows :
边栏推荐
- 知识点滴 - 折叠锻打和大马士革钢
- opencv显示图像
- 常用的无线充发射IC芯片
- 51万奖池邀你参战——第二届阿里云ECS CloudBuild开发者大赛来袭
- 云原生数据库是未来数据库的天下
- How much disk IO will actually occur for a byte of the read file?
- Go grouping & sorting
- Wechat applet: future wife query generator
- Win software - (net framework) processed the certificate chain but terminated in a root certificate that is not trusted by the trusted provider
- Wechat applet; AI intelligent dubbing assistant
猜你喜欢

What if win11 cannot record audio? Solution of win11 unable to input sound

Today's sleep quality record 80 points

Pkav simple blasting

Go language -panic and recover

MCS: continuous random variable - student's t distribution

Jenkins installs and deploys and automatically builds and publishes jar applications

数学分析_笔记_第1章:集合与映射

Alibaba cloud object storage oss+picgo+typera implements the construction map

Database connection exception: create connection error, url: jdbc: mysql://ip/ Database name, errorcode 0, state 08s01 problem handling

Wechat applet: unfashionable love talk
随机推荐
Qimen dunjia assistant decision software
C prime plus notes d'apprentissage - 2, constantes et formatage io (I / o)
阿里云对象存储oss+picgo+typora实现构建图床
When I was young, I thought my father was omnipotent
Special research on Intelligent upgrading of heavy trucks in China in 2022
英集芯IP5566带TYPE-C口3A充放快充移动电源5w无线充二合一方案SOC
Yingjixin launched 4 series of lithium batteries 100W mobile power supply voltage rise and fall scheme SOC chip ip5389
Mathematical analysis_ Notes_ Chapter 1: set and mapping
Three implementation methods: left fixed and right adaptive (Flex, float + BFC, float margin left)
Wechat applet: future wife query generator
Build a gocd environment
常用的无线充发射IC芯片
C primer plus学习笔记 —— 2、常量与格式化IO(输入/输出)
Wechat applet: a new interesting test
When I was young, I thought my father was omnipotent
FS4059A与FS5080E充电芯片的区别
树莓派assert初步使用练习
Jsonfield annotation in fastjson
Konva series tutorial 1:what is konva?
LeetCode-1757. Recyclable and low-fat products_ SQL