当前位置:网站首页>[SQL's 18 dragon subduing palms] 01 - Kang long regrets: introductory 10 questions
[SQL's 18 dragon subduing palms] 01 - Kang long regrets: introductory 10 questions
2022-07-29 01:27:00 【m0_ sixty-seven million three hundred and ninety-three thousand】

front said
?? Author's brief introduction :, Long distance runner , Determined to persist in writing 10 Blog of the year , Focus on java Back end
?? Column Introduction :mysql Basics 、 Advanced , Main explanation mysql database sql Brush problem 、 Advanced knowledge , Include index 、 Database tuning 、 Sub warehouse, sub table, etc
?? The article brief introduction : This article will introduce the recommended collection for standby .
?? Related to recommend :
- MySql Advanced index 01—— Explain the data structure of the index in depth :B+ Trees
- Mysql Advanced index 02——InnoDB The data storage structure of storage engine
- Mysql Advanced index 03——2 A new feature ,11+7 Design principles for creating indexes
- Mysql Advanced optimization 01—— 40000 word detailed database performance analysis tool ( thorough 、 comprehensive 、 detailed , Keep it in reserve )
- Big factory SQL Complete interview questions
List of articles
- 1 Query result de duplication
- 2. Rename the queried column
- 3 Find user information for a certain age group
- 4 Find user information except Fudan University
- 5 use where Filter null exercises
- 6 Where in and Not in
- 7 Operators mix
- 8 View users with Beijing in the school name
- 9 Calculate the number of boys and the average GPA
- 10 Group calculation exercises
1 Query result de duplication
subject : Now the operation needs to check which schools users come from , Please take the school's de duplication data from the user information table .

Original link :sql Question bank :sql3 Query result de duplication
Answer key :
select distinct university from user_profile
2. Rename the queried column

Answer key :
select device_id as user_infos_example from user_profile limit 2
Original link :sql Question bank :SQL5 Rename the queried column
3 Find user information for a certain age group

Answer key :
select device_id,gender,age from user_profile where age between 20 and 23
Original link :sql Question bank :SQL8 Find user information for a certain age group
4 Find user information except Fudan University

Answer key :
select device_id,gender,age,university from user_profile where university != " Fudan University "
Original link :sql Question bank :SQL9 Find user information except Fudan University
5 use where Filter null exercises

select device_id,gender,age,university from user_profile where age is not null
Original link :sql Question bank :SQL10 use where Filter null exercises
6 Where in and Not in

select device_id,gender,age,university,gpa
from user_profile
where university in (" Peking University, "," Fudan University "," Shandong University ")
Original link :sql Question bank :SQL13 Where in and Not in
7 Operators mix

Answer key 1( Written in simple , Query efficiency is low )
select device_id,gender,age,university,gpa
from user_profile
where gpa > 3.5 and university = " Shandong University "
or gpa > 3.8 and university = " Fudan University "
Answer key 2( The writing is complicated , High query efficiency )
select device_id, gender, age, university, gpa
from user_profile
where device_id in
(select device_id from user_profile where gpa>3.5 and university=' Shandong University ')
or device_id in
(select device_id from user_profile where gpa>3.8 and university=' Fudan University ')
Original link :sql Question bank :SQL14 Operators mix
8 View users with Beijing in the school name

?? Knowledge point
The matching string can contain the following four wildcards :
_: Matches any character ;
%: matching 0 Characters or more ;
[ ]: matching [ ] Any character in ( If the characters to be compared are continuous , You can use hyphens “-” surface reach );
[^ ]: Mismatch [ ] Any character in .
Answer key :
select device_id, age, university from user_profile where university like "% Beijing %"
Original link :sql Question bank :SQL15 View users with Beijing in the school name
9 Calculate the number of boys and the average GPA

select count(gender) as male_num,
avg(gpa) as avg_gpa
from user_profile where gender="male"
Original link :sql Question bank :SQL17 Calculate the number of boys and the average GPA
10 Group calculation exercises


Answer key :
select
gender, university,
count(device_id) as user_num,
avg(active_days_within_30) as avg_active_days,
avg(question_cnt) as avg_question_cnt
from user_profile
group by gender, university
Original link :sql Question bank :SQL18 Group calculation exercises
“ A good workman does his work well , You must sharpen your tools first ”. To become a professional sql master , Questions during the interview , Walking alone in the Jianghu , You have to get one " Martial arts script ".
I personally push Niuke : Looking for work artifact | Big factory java Face to face summary | Super full written examination question bank
Recommended reasons :
1. Brush the question bank , The topic is particularly comprehensive , I don't worry about the written test anymore
link : Looking for work artifact | Big factory java Face to face summary | Super full written examination question bank
2. Super comprehensive test questions 、 As a system 、 High-quality , also AI Simulated interview black Technology
link : Work artifact | Big factory java Face to face summary | Super full written examination question bank
3. Polyhedral warp , Big factories have a lot of experience
4. Extrapolating opportunities , Large factories have a lot of recruitment
link : Looking for work artifact | Big factory java Face to face summary | Super full written examination question bank
5. The real topic of big factory , Get the real question bank of Dachang directly , And has direct cooperation with many large factories , The title has a high pass rate and has the opportunity to obtain the qualification of large-scale promotion .
link : Looking for work artifact | Big factory java Face to face summary | Super full written examination question bank
边栏推荐
- uniapp createSelectorQuery().select 获取返回null报错
- DVWA之SQL注入
- SQL question brushing: find the current salary details and department number Dept_ no
- 表达式求值
- (perfect solution) why is the effect of using train mode on the train/val/test dataset good, but it is all very poor in Eval mode
- Solid smart contract tutorial (5) -nft auction contract
- [idea] where to use the query field
- 【ManageEngine】助力哈尔滨工程大学实现网络流量一体化监控管理
- Synchronized keyword details
- nep 2022 cat
猜你喜欢

Hilbert transform and instantaneous frequency

【idea】查询字段使用位置

Docuware mobile labor solution can help you build a new productivity model: anytime, anywhere, any device

Tupu software appeared at the 2022 Fuzhou digital Expo to jointly create a new digital era

一文让你搞懂MYSQL底层原理。-内部结构、索引、锁、集群

DocuWare 移动劳动力解决方案可帮助您构建新的生产力模式:随时随地、任何设备

SQL question brushing: find the current salary details and department number Dept_ no

Canal实时解析mysql binlog数据实战

Solid smart contract tutorial (5) -nft auction contract

Docker-compose安装mysql
随机推荐
How to implement the time impact analysis of the construction project?
Flink SQL Hudi 实战
uniapp createSelectorQuery().select 获取返回null报错
Date conversion EEE MMM DD hh:mm:ss zzz YYYY
Expression evaluation
Visual full link log tracking
【mysql】多指标历史累计去重问题
括号匹配的检验
Univariate function integration 1__ Indefinite integral
Error installing mysqlclient module on MAC system
ActiveMQ basic details
RHCE command practice (II)
Canal实时解析mysql binlog数据实战
Interviewer: programmer, please tell me who leaked the company interview questions to you?
Flask reports an error: pymysq1.err OperationalError:(1054, “Unknown column ‘None‘ in ‘field list‘“)
RHCE命令练习(二)
How to check the redis Version (check the redis process)
Redis installation, cluster deployment and common tuning
DVWA之SQL注入
北京护照西班牙语翻译推荐




