十一个高级MySql面试题


Posted in 面试题 onOctober 06, 2014
1. Explain MySQL architecture. – The front layer takes care of network connections and security authentications, the middle layer does the SQL query parsing, and then the query is handled off to the storage engine. A storage engine could be either a default one supplied with MySQL (MyISAM) or a commercial one supplied by a third-party vendor (ScaleDB, InnoDB, etc.)
2. Explain MySQL locks. – Table-level locks allow the user to lock the entire table, page-level locks allow locking of certain portions of the tables (those portions are referred to as tables), row-level locks are the most granular and allow locking of specific rows.

3. Explain multi-version concurrency control in MySQL. – Each row has two additional columns associated with it – creation time and deletion time, but instead of storing timestamps, MySQL stores version numbers.
4. What are MySQL transactions? – A set of instructions/queries that should be executed or rolled back as a single atomic unit.
5. What’s ACID? – Automicity – transactions are atomic and should be treated as one in case of rollback. Consistency – the database should be in consistent state between multiple states in transaction. Isolation – no other queries can access the data modified by a running transaction. Durability – system crashes should not lose the data.
6. Which storage engines support transactions in MySQL? – Berkeley DB and InnoDB.
7. How do you convert to a different table type? – ALTER TABLE customers TYPE = InnoDB
8. How do you index just the first four bytes of the column? – ALTER TABLE customers ADD INDEX (business_name(4))
9. What’s the difference between PRIMARY KEY and UNIQUE in MyISAM? – PRIMARY KEY cannot be null, so essentially PRIMARY KEY is equivalent to UNIQUE NOT NULL.
10. How do you prevent MySQL from caching a query? – SELECT SQL_NO_CACHE …
11. What’s the difference between query_cache_type 1 and 2? – The second one is on-demand and can be retrieved via SELECT SQL_CACHE … If you’re worried about the SQL portability to other servers, you can use SELECT /* SQL_CACHE */ id FROM … – MySQL will interpret the code inside comments, while other servers will ignore it.

Tags in this post...

面试题 相关文章推荐
介绍java中初始化块的使用
Sep 11 面试题
我有一个char * 型指针正巧指向一些int 型变量, 我想跳过它们。 为什么如下的代码((int *)p)++; 不行?
May 09 面试题
介绍一下sql server的安全性
Aug 10 面试题
不用游标的SQL语句有哪些
Sep 07 面试题
阿里巴巴的Oracle DBA笔试题答案-SQL tuning类
Apr 03 面试题
使用索引有什么好处
Jul 27 面试题
某公司的.net工程师面试题笔试题
Nov 22 面试题
C#怎么让一个窗口居中显示?
Oct 20 面试题
linux面试相关问题
Apr 28 面试题
什么是SCM(软件配置管理)
Aug 16 面试题
Java如何读取CLOB字段
Oct 10 面试题
UNIX操作系统结构由哪几部分组成
Feb 17 面试题
遇到的Mysql的面试题
Jun 29 #面试题
一些关于MySql加速和优化的面试题
Jan 30 #面试题
MYSQL支持事务吗
Aug 09 #面试题
MYSQL基础面试题
May 13 #面试题
mysql有关权限的表都有哪几个
Apr 22 #面试题
介绍一下mysql的日期和时间函数
Mar 28 #面试题
介绍一下MYSQL常用的优化技巧
Oct 25 #面试题
You might like
php做下载文件的实现代码及文件名中乱码解决方法
2011/02/03 PHP
PHP中文分词的简单实现代码分享
2011/07/17 PHP
php屏蔽错误及提示的方法
2020/05/10 PHP
实用的Jquery选项卡TAB示例代码
2013/08/28 Javascript
Node.js中child_process实现多进程
2015/02/03 Javascript
AngularJS 模块详解及简单实例
2016/07/28 Javascript
Javascript动画效果(4)
2016/10/11 Javascript
解析jQueryEasyUI的使用
2016/11/22 Javascript
jQuery插件FusionCharts实现的2D柱状图效果示例【附demo源码下载】
2017/03/06 Javascript
微信小程序 图片加载(本地,网路)实例详解
2017/03/10 Javascript
vue组件间通信子与父详解(二)
2017/11/07 Javascript
快速解决处理后台返回json数据格式的问题
2018/08/07 Javascript
VUE-cli3使用 svg-sprite-loader
2018/10/20 Javascript
Vue中Axios从远程/后台读取数据
2019/01/21 Javascript
在NPM发布自己造的轮子的方法步骤
2019/03/09 Javascript
vue项目中仿element-ui弹框效果的实例代码
2019/04/22 Javascript
微信小程序如何使用云开发
2019/05/17 Javascript
深入浅析ng-bootstrap 组件集中 tabset 组件的实现分析
2019/07/19 Javascript
[41:08]2014 DOTA2国际邀请赛中国区预选赛 HGT VS NE
2014/05/22 DOTA
21行Python代码实现拼写检查器
2016/01/25 Python
python脚本作为Windows服务启动代码详解
2018/02/11 Python
ubuntu系统下使用pm2设置nodejs开机自启动的方法
2018/05/12 NodeJs
Python常见排序操作示例【字典、列表、指定元素等】
2018/08/15 Python
详解小白之KMP算法及python实现
2019/04/04 Python
python或C++读取指定文件夹下的所有图片
2019/08/31 Python
Python如何把多个PDF文件合并代码实例
2020/02/13 Python
美国知名的在线旅游服务网站:Priceline
2016/07/23 全球购物
AVIS安飞士奥地利租车官网:提供奥地利、欧洲和全世界汽车租赁
2016/11/29 全球购物
澳大利亚音乐商店:Bava’s Music City
2019/05/05 全球购物
优秀的教师个人的中文求职信
2013/09/21 职场文书
外企财务年会演讲稿
2014/01/03 职场文书
医院护士见习期自我鉴定
2014/09/15 职场文书
户籍证明模板
2014/09/28 职场文书
《这片土地是神圣的》教学反思
2016/02/16 职场文书
2016学雷锋优秀志愿者事迹材料
2016/02/25 职场文书
MySQL中distinct与group by之间的性能进行比较
2021/05/26 MySQL