当前位置: 首页 > news >正文

高频SQL50题 第一天 | 1757. 可回收且低脂的产品、584. 寻找用户推荐人、595. 大的国家、1683. 无效的推文、1148. 文章浏览 I

1757. 可回收且低脂的产品

题目链接:https://leetcode.cn/problems/recyclable-and-low-fat-products/description/?envType=study-plan-v2&envId=sql-free-50
状态:已完成

考点:无

select product_id
from Products
where low_fats = 'Y' and recyclable = 'Y'

584. 寻找用户推荐人

题目链接:https://leetcode.cn/problems/find-customer-referee/description/?envType=study-plan-v2&envId=sql-free-50
状态:已完成

考点:where子句的等值判断会自动忽略null值,因此需要增加判空逻辑

select name
from Customer
where referee_id != 2 or referee_id is null

595. 大的国家

题目链接:https://leetcode.cn/problems/big-countries/description/?envType=study-plan-v2&envId=sql-free-50
状态:已完成

考点:无

select name, population, area
from World
where area >= 3000000 or population >= 25000000

1683. 无效的推文

题目链接:https://leetcode.cn/problems/invalid-tweets/description/?envType=study-plan-v2&envId=sql-free-50
状态:已完成

考点:length()函数求解字符串的长度

select tweet_id
from Tweets
where length(content) > 15

1148. 文章浏览 I

题目链接:https://leetcode.cn/problems/article-views-i/description/?envType=study-plan-v2&envId=sql-free-50
状态:已完成

考点:修改列名(as),去重(distinct),排序(order by,默认升序)

select distinct author_id as id
from Views
where author_id = viewer_id
order by author_id

相关文章:

  • 3.19刷题
  • 【VUE】day05-ref引用
  • 3.18-1
  • 基于Spring Boot的冷链物流系统的设计与实现的设计与实现(LW+源码+讲解)
  • docker需要sudo才能使用
  • Qt窗口控件之颜色对话框QColorDialog
  • jvm中每个类的Class对象是唯一的吗
  • 计算机网络分层结构
  • 【第14节】windows sdk编程:进程与线程介绍
  • Vue下载与安装步骤
  • Windows Docker 报错: has no HTTPS proxy,换源
  • 网络空间安全(37)获取webshell方法总结
  • 面试八股 —— Redis篇
  • Dagger2从入门到放弃
  • c++ - 笔记
  • C/C++结构体简单介绍
  • 深度学习:从零开始的DeepSeek-R1-Distill有监督微调训练实战(SFT)
  • Python 中下划线 “_” 的多面性:从变量到约定
  • java agent 学习
  • 阿里云平台服务器操作以及发布静态项目
  • 把网站做静态化/抖音推广合作方式
  • 吉林省 网站建设/平台seo什么意思
  • wordpress图片轮播/搜狗seo培训
  • 专做视频和ppt的网站/百度地图3d实景地图
  • 做钻石的网站/爱网站关键词查询工具
  • 专业的上海网站建设公司排名/win11优化大师