当前位置:网站首页>LeetCode-1757. Recyclable and low-fat products_ SQL
LeetCode-1757. Recyclable and low-fat products_ SQL
2022-06-23 05:30:00 【_ trickle】
- SQL framework
surface :Products
±------------±--------+
| Column Name | Type |
±------------±--------+
| product_id | int |
| low_fats | enum |
| recyclable | enum |
±------------±--------+
product_id It's the primary key of this table .
low_fats Is enumeration type , The values are the following two (‘Y’, ‘N’), among ‘Y’ Indicates that the product is a low-fat product ,‘N’ It means it's not a low-fat product .
recyclable Is enumeration type , The values are the following two (‘Y’, ‘N’), among ‘Y’ Indicates that the product is recyclable , and ‘N’ Indicates non recyclable .
Write SQL sentence , Find product numbers that are both low-fat and recyclable .
Return results No sequence requirements .
The query result format is shown in the following example :
Products surface :
±------------±---------±-----------+
| product_id | low_fats | recyclable |
±------------±---------±-----------+
| 0 | Y | N |
| 1 | Y | Y |
| 2 | N | Y |
| 3 | Y | Y |
| 4 | N | N |
±------------±---------±-----------+
Result surface :
±------------+
| product_id |
±------------+
| 1 |
| 3 |
±------------+
Only products id by 1 and 3 Products , Both low-fat and recyclable products .
Program code
# Write your MySQL query statement below
select product_id
from Products
where low_fats = 'Y' and recyclable = 'Y'
边栏推荐
- The weak are as irritable as tigers, the strong are as calm as water, and the really powerful have already given up their emotions
- Web application security testing guide
- pkav简单爆破
- Qt QWidget嵌套相对位置获取 (qt 画线 嵌套)
- When SBAS encounters rtklib
- WebRTC[47] - WebRTC 保存 YUV 数据的常用方式
- Introduction to JDBC (IV) - use of Druid connection pool
- bat中获取bat命令结果
- Complete the primary school project in 3 days, and teach you to complete the weather broadcast system hand in hand!
- H5 适配全面屏
猜你喜欢

云原生大趋势下的容器化技术现状与发展

MCS:连续随机变量——Chi-Square分布

Web application security testing guide

JDBC入门学习(三)之事务回滚功能的实现
![[leetcode] longest increasing subsequence problem and its application](/img/e0/d666dccec1f65eed61fce83ac2190a.png)
[leetcode] longest increasing subsequence problem and its application

Facing new challenges and becoming a better self -- an advanced technology er

(IntelliJ) plug in background image plus

H5 adaptive full screen

网上有真实的兼职吗?大学生怎么找暑期兼职?

数据库连接异常:create connection error, url: jdbc:mysql://ip/数据库名, errorCode 0, state 08S01问题处理
随机推荐
MCS: continuous random variable - student's t distribution
Introduction and use of precise ephemeris
Win软件 - (Net-Framework)已处理证书链,但是在不受信任提供程序信任的根证书中终止
STM32cube 串口使用DMA+IDLE接收不定长数据
面对新的挑战,成为更好的自己--进击的技术er
About information disclosure and defense
Web application security testing guide
JDBC入门学习(四)之Druid连接池的使用
C语言栈实现
MCS: continuous random variable lognormal distribution
应用挂了~
STM32cube CMSIS_V2 freeRTOS Queue 队列使用
戏问花门酒家翁
[leetcode] longest increasing subsequence problem and its application
弱者易怒如虎,强者平静如水,真正厉害的人早已戒掉了情绪
App hangs~
Implementation of MySQL custom sequence number
Event log keyword: eventlogtags logtags
VMware network connection error unit network service not found
MCS: continuous random variable chi square distribution