当前位置:网站首页>[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
边栏推荐
- 全面升级,你能想象的都在这————京东API接口
- 地下水、土壤、地质、环境人看过来
- ActiveMQ basic details
- 表达式求值
- TextKit 自定义UILabel识别链接
- 日期转换 EEE MMM dd HH:mm:ss zzz yyyy
- PlatoFarm社区生态福音,用户可借助Elephant Swap获得溢价收益
- Mathematical modeling and detailed explanation of basic knowledge (common knowledge points of Chemistry)
- (完美解决)为什么在train/val/test数据集上用train模式效果都很好,但是在eval模式下全部很差
- Common functions and usage of numpy
猜你喜欢

Seven SQL performance optimizations that spark 3.0 must know

How to implement the time impact analysis of the construction project?

ACM SIGIR 2022 | interpretation of selected papers of meituan technical team

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

Hilbert transform and instantaneous frequency

Interviewer: programmer, please tell me who leaked the company interview questions to you?

nep 2022 cat

Flink SQL Hudi actual combat

PLATO上线LAAS协议Elephant Swap,用户可借此获得溢价收益

Expression evaluation
随机推荐
表达式求值
Flink Postgres CDC
Flask project construction 2
Instruction rearrangement, happens before, as if serial
量化交易之数字货币篇 - 生成foot print因子数据
Letax record \documentclass{}, authoryear attribute is used
C语言300行代码实现扫雷(可展开+可标记+可更改困难级别)
[ManageEngine] what is the LAN monitoring software and what is its function
[ManageEngine] help Harbin Engineering University realize integrated monitoring and management of network traffic
Flink SQL Hudi 实战
[MySQL] historical cumulative de duplication of multiple indicators
Numpy 常见函数及使用
Spark 3.0 中七个必须知道的 SQL 性能优化
How to implement the time impact analysis of the construction project?
Hilbert transform and instantaneous frequency
Closures and decorators
Self-attention neural architecture search for semantic image segmentation
Flash reports an error: type object 'news' has no attribute' query 'the view name is duplicate with the model name
[idea] where to use the query field
Django uses pymysql module to connect mysql database




