当前位置:网站首页>SQL exercise (I)
SQL exercise (I)
2022-04-23 12:05:00 【Copy the wrong code】
Catalog
Query results limit the number of rows returned
Sort multiple columns after searching
Find the student information of the school is Peking University
Look for ages greater than 24 Users of
Find user information for a certain age group
Find user information except Fudan University
use where Filter null exercises
Study SQL It's been a while , Want to master it more skillfully , Then only brush the questions ~~~
Brush the question website : Cattle from - Looking for work artifact | Written examination question bank | The interview experience | Internship recruitment push , One stop job search _ Cattle from
https://www.nowcoder.com/exam/oj?tab=SQL%E7%AF%87&topicId=199&fromPut=pc_zh_n_you_sql
-
SQL Non technical quick start
-
Basic query
-
Query all columns

Code :select sentence
select * from user_profile
-
Query multiple columns

Code : From table select Out : equipment ID, Gender , Age school listing is OK
select device_id,gender,age,university -- equipment ID, Gender , Age school
from user_profile
-
Query result de duplication

Code :distinct duplicate removal
select distinct university
FROM user_profile
-
Query results limit the number of rows returned
Code :where Conditions of the query
select device_id
from user_profile
where id<=2
- Rename the queried column

Code :as rename , Rename and :
select device_id as user_infos_example
from user_profile
where id<=2
-
Conditions of the query
- Sort after finding

Code :order by Name asc/desc asc Ascending ,desc Descending , The default sort is Ascending
select device_id,age from user_profile order by age
-
Sort multiple columns after searching

Code :
select device_id, gpa, age from user_profile
order by gpa asc, age asc
- Sort in descending order after finding

Code :desc Descending order
select device_id,gpa,age
from user_profile
order by gpa desc,age desc
-
Find the student information of the school is Peking University

Code :where Statement condition query
select device_id,university
from user_profile
where university=' Peking University, '
-
Look for ages greater than 24 Users of

Code :
select device_id,gender,age,university
from user_profile
where age>24
-
Find user information for a certain age group

Code :and Parallel conditions
select device_id,gender,age
from user_profile
where age>=20 and age<=23
-
Find user information except Fudan University
Code :!= It's not equal to
select device_id, gender, age, university
from user_profile
where university != ' Fudan University '
-
use where Filter null exercises

Code :
select device_id,gender,age,university
from user_profile
where age !=' '

版权声明
本文为[Copy the wrong code]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231156018883.html
边栏推荐
- Interpreting the art created by robots
- Running error: unable to find or load the main class com xxx. Application
- 运行报错:找不到或无法加载主类 com.xxx.Application
- Idea database navigator plug-in
- Fabric 1.0 source code analysis (33) implementation of peer channel command and subcommand
- Yunna | how to manage the company's fixed assets and how to manage fixed assets
- Symmetric encryption, certificate encryption
- golang之笔试题&面试题01
- Castle. Dynamic proxy implements transaction unit control
- How to expand the capacity of the server in the 100 million level traffic architecture? Well written!
猜你喜欢

云呐|如何管理好公司的固定资产,固定资产管理怎么做

Nacos Foundation (7): Configuration Management

程序员如何用130行代码敲定核酸统计
![[redis series] redis learning 13. Redis often asks simple interview questions](/img/4c/2440af6daa26a0ca6cb64f32bf138e.png)
[redis series] redis learning 13. Redis often asks simple interview questions

Database Navigator 使用默认MySQL连接提示:The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or repres

怎么进行固定资产盘点,资产盘点报告如何一键生成

Use kettle to copy records to and get records from results

Practical data Lake iceberg lesson 30 MySQL - > iceberg, time zone problems of different clients

5个免费音频素材网站,建议收藏

C# F23.StringSimilarity库 字符串重复度、文本相似度、防抄袭
随机推荐
Step function of activation function
Idea code formatting plug-in save actions
对称加密、证书加密
运行报错:找不到或无法加载主类 com.xxx.Application
IMEU如何与IMCU相关联(IM 5.5)
Summary of convolution layer and pooling layer
ThinkPHP adds image text watermark to generate promotion poster with QR code
VMware虚拟机使用esxi 导出硬盘vmdk文件
The fourth chapter is the enable and disable columns of IM enabled fill objects (Part III of im-4.3)
thinkphp 添加图片文字水印生成带二维码的推广海报
Chapter 4: enable and disable im column storage for materialized view (IM 4.6)
第四章 为物化视图启用和禁用IM列存储(IM 4.6)
Resolution due to AMD not found_ ags_ x64. DLL, unable to continue code execution. Reinstallation of the program may solve this problem, Forza horizon 5
异步时钟亚稳态 的解决方案——多bit信号
NativeForMySQL 连接MySQL8 提示:1251- Client does not support authentication protocol
获取钉钉考勤机打卡记录
Nacos Foundation (8): login management
激活函数之sigmoid函数
ES6学习笔记二
魔域来了H5游戏详细图文架设教程
