当前位置:网站首页>MySQL interview questions
MySQL interview questions
2022-06-24 13:24:00 【Quinlan】
mysql The scenario of index creation and the problem of index invalidation ?
MySQL The scenarios for indexing are
- Create an index for fields with high query frequency ;
- Sort 、 grouping 、 Index fields with high query frequency ;
- If you need to set multiple columns as indexes , You can use a multi column index
- Select a unique index and try to use an index with less data
The reason for index failure
1. Function parameters or expressions appear in the index column
Solution : Calculate the value of the expression in advance
2. Use left blur
Solution : Try to avoid
3. Use OR Some fields of the query have no index
Solution :or Add an index to the field
4. No single quotation marks
surface 1: Person
+-------------+---------+
| Name | type |
+-------------+---------+
| PersonId | int |
| FirstName | varchar |
| LastName | varchar |
+-------------+---------+
PersonId Is the primary key of the above table
surface 2: Address
+-------------+---------+
| Name | type |
+-------------+---------+
| AddressId | int |
| PersonId | int |
| City | varchar |
| State | varchar |
+-------------+---------+
AddressId Is the primary key of the above table
Write a SQL Inquire about , Meet the conditions : No matter what person Is there address information , Both need to be provided based on the above two tables person For :
边栏推荐
- Understanding openstack network
- Open source monitoring system Prometheus
- Sqlserver 2000 has long-lasting vitality
- 使用 Abp.Zero 搭建第三方登录模块(一):原理篇
- Cmput 379 explanation
- Express 100 Express query interface (API) interface specification document - detailed version
- Several common DoS attacks
- How to create a new empty branch in the web development process of easyrtc?
- 39 - read XML node and attribute values
- 1、贪吃蛇游戏设计
猜你喜欢

3. Caller 服务调用 - dapr

Kubernetes集群部署

如何避免严重网络安全事故的发生?

一文理解OpenStack网络

1. Snake game design

Getting started with the go Cobra command line tool

"I, an idiot, have recruited a bunch of programmers who can only" Google "

我从根上解决了微信占用手机内存问题
![[data mining] final review (sample questions + a few knowledge points)](/img/90/a7b1cc2063784fb53bb89b29ede5de.png)
[data mining] final review (sample questions + a few knowledge points)

青藤入选工信部网安中心“2021年数字技术融合创新应用典型解决方案”
随机推荐
Quickly understand the commonly used message summarization algorithms, and no longer have to worry about the thorough inquiry of the interviewer
Coinbase将推出首个针对个人投资者的加密衍生产品
我开导一个朋友的一些话以及我个人对《六祖坛经》的一点感悟
How can junior middle school developers effectively reduce their own workload?
Go deep into high-performance JSON parsing libraries in go
YOLOv6:又快又准的目标检测框架开源啦
openGauss内核:简单查询的执行
Comparator 排序函数式接口
Nifi from introduction to practice (nanny level tutorial) - environment
LVGL库入门教程 - 颜色和图像
Getting started with the go Cobra command line tool
关于被黑数据库那些事
问个sql view的问题
Who is the fish and who is the bait? Summary of honeypot recognition methods from the perspective of red team
Why does the kubernetes environment require that bridge NF call iptables be enabled?
我从根上解决了微信占用手机内存问题
Party, Google's autoregressive Wensheng graph model
Leetcode 1218. 最长定差子序列
Interviewer: the MySQL database is slow to query. What are the possible reasons besides the index problem?
Understanding openstack network