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

Mysql基础练习题 1757.可回收且低脂的产品(力扣)

编写解决方案找出既是低脂又是可回收的产品编号。

题目链接:

https://leetcode.cn/problems/recyclable-and-low-fat-products/description/

建表插入数据:

Create table If Not Exists Products (product_id int, low_fats ENUM('Y', 'N'), recyclable ENUM('Y','N'))
Truncate table Products
insert into Products (product_id, low_fats, recyclable) values ('0', 'Y', 'N')
insert into Products (product_id, low_fats, recyclable) values ('1', 'Y', 'Y')
insert into Products (product_id, low_fats, recyclable) values ('2', 'N', 'Y')
insert into Products (product_id, low_fats, recyclable) values ('3', 'Y', 'Y')
insert into Products (product_id, low_fats, recyclable) values ('4', 'N', 'N')

画图分析:

代码实现:

select product_id from products where low_fats = 'Y' and recyclable='Y';


http://www.kler.cn/a/298317.html

相关文章:

  • 二叉树 - 验证二叉搜索树
  • 知识蒸馏-KD
  • js 有关小数的方法
  • 低代码开发技术在农村现代化中的应用探索
  • FPGA硬件设计语言:VHDL和System Verilog
  • 叠螺污泥脱水机的成本包括哪些方面
  • 如何在红米手机中恢复已删除的照片?(6 种方式可供选择)
  • .NET 自定义过滤器 - ActionFilterAttribute
  • Go入门语法
  • Git的基本概念和使用方式
  • 2024临床常用的肺栓塞评估量表汇总!
  • 基于Ubuntu+PostgreSQL+Zip搭建SonarQube环境
  • 【计算机网络】UDP TCP介绍
  • MySQL record 04 part
  • 如何让Google收录我的网站?
  • Vue3+TypeScript频谱跳动算法(附vue2+JavaScript)
  • FreeRTOS学习笔记(七)信号量
  • SAP ABAP 删除请求
  • 文本字符分割算法尝试
  • 哈希表的底层实现(2)---C++版