当前位置:网站首页>Chapter 2 basic query and sorting
Chapter 2 basic query and sorting
2022-07-23 14:28:00 【Sand in Changsha】
Q2.1
SELECT product_name, regist_date
FROM product
WHERE regist_date >'2009-04-28';
Q2.2
product_id|product_name|product_type|sale_price|purchase_price|regist_date|
----------+------------+------------+----------+--------------+-----------+
Q2.3
SELECT product_name, sale_price, purchase_price
FROM product
WHERE sale_price - purchase_price>=500;
SELECT product_name, sale_price, purchase_price
FROM product
WHERE purchase_price-sale_price <=-500;
Q2.4
SELECT product_name,product_type, sale_price*0.9-purchase_price As "profit"
FROM product
WHERE sale_price*0.9-purchase_price >100;
Q2.5
The errors that have occurred are :
- sum Functions can only use numeric columns as parameters
- At the end of the aggregate function SELECT Clause specifies the use of columns other than aggregate keys COUNT Wait for the aggregate function ,SELECT If the column name appears in the clause , Can only be GROUP BY The column name specified in clause ( That's the aggregate bond ).
- WHERE The clause is written in GROUP BY After Clause
Q2.6
SELECT product_type,SUM(sale_price), SUM(purchase_price)
FROM product
GROUP BY product_type
HAVING SUM(sale_price)>1.5*SUM(purchase_price) ;
Q2.7
select * from product
order by - regist_date;
边栏推荐
- BGP federal experiment
- Interface
- JS to implement encode64 encryption
- 过程块和方法
- ArcGIS uses DEM data to delineate the specific steps and processes of catchment area
- Comparison of iqoo 10 pro and Xiaomi 12 ultra configurations
- 第2章 基础查询与排序
- Uiscrollview (uicollectionview) prohibits horizontal and vertical sliding at the same time
- 全志F1C100S/F1C200S学习笔记(13)——LVGL移植
- Is there a big gap between core i5 12490f and i5 12600K
猜你喜欢
![寻找峰值[抽象二分练习]](/img/99/122e79784f0f07120680d2cbcf89da.png)
寻找峰值[抽象二分练习]

Changing the historical length of chart during LabVIEW operation

antd form表单——重置方法不生效——基础积累——prop的重要性

NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘

数据库连接池 & DBUtils

npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead.

Towhee 每周模型

Surrounded Regions

【附下载】值得收藏的几款渗透测试常用的脚本

动态规划-- 背包问题
随机推荐
多重背包!
Summary of JS data type judgment methods
ArcGIS使用DEM数据划定汇水区具体步骤过程
NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library ‘*****‘
完全背包!
The difference between Celeron n4000 and Celeron n5095
Process blocks and methods
子序列 --- 编辑距离
【FLink】FLink Hash collision on user-specified ID “opt“. Most likely cause is a non-unique ID
回文相关题目
ArcGIS uses DEM data to delineate the specific steps and processes of catchment area
ThreadLocal interview Kills 11 consecutive questions
剑指offer19 正则表达式
[download attached] several scripts commonly used in penetration testing that are worth collecting
Towhee 每周模型
What level of rtx3070ti graphics card? What level of rtx3070ti graphics card? How about rtx3070ti graphics card
Experience in developing large crawlers in requests Library
shell跑的時候需要的需要了解命令
What level is the notebook core i5 1135g7 equivalent to? How about i5 1135g7 performance
Tensor, numpy, PIL format conversion and image display