LeetCode 高频 SQL 50 题(底子版)之 【查询】部分
标题:1757. 可采取且低脂的产物https://i-blog.csdnimg.cn/direct/6ba89912bc7d4e6ca464f83ee1970983.png
https://i-blog.csdnimg.cn/direct/5e19a5cfbd454da4999e24c26c13b872.png
题解:
selectproduct_idfrom Products where low_fats = 'Y' and recyclable = 'Y'
标题:584. 寻找用户保举人
https://i-blog.csdnimg.cn/direct/c88a53e8d7d541d2b74d13c35f87f5cd.png
https://i-blog.csdnimg.cn/direct/9a269f692b8a475489e7efbabca63c94.png
题解:
select name from Customer where referee_id != 2 or referee_id is NULL
select name from Customer
where id not in (select id from Customer where referee_id = 2)
标题:595. 大的国家
https://i-blog.csdnimg.cn/direct/a920436f1a654b31bcbfc4b282c5abb8.png
https://i-blog.csdnimg.cn/direct/5e4349e31a504866ae724563640fc479.png
题解:
select name,population,area from World where area>=3000000 or population>=25000000
select name,population,area from World where area>=3000000
union
select name,population,area from World where population>=25000000
标题:1148. 文章欣赏 I
https://i-blog.csdnimg.cn/direct/a5371942ffe54f55a1386d9f8918e57a.png
https://i-blog.csdnimg.cn/direct/6a17b343bead4e93b8af0cd8c0266902.png
题解:
select distinct author_id as id from Views where author_id = viewer_id order by author_id
标题:1683. 无效的推文
https://i-blog.csdnimg.cn/direct/b8c24ff473da424a87a2d88c07d7a422.png
https://i-blog.csdnimg.cn/direct/18fedd06eae64e2797e27af15a7980d4.png
题解:
select tweet_id from Tweets where CHAR_LENGTH(content) >15
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]