十一个高级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...

面试题 相关文章推荐
Yahoo-PHP面试题1
Jul 20 面试题
JPA面试常见问题
Nov 14 面试题
C语言编程练习
Apr 02 面试题
int *p=NULL和*p= NULL有什么区别
Oct 23 面试题
如何在存储过程中使用Loop
Jan 05 面试题
Oracle的内存结构(Memory structures)
Jun 10 面试题
.NET remoting中对象激活的两种方式
Jun 08 面试题
介绍一下.NET构架下remoting和webservice
May 08 面试题
C#面试题问题集
Apr 02 面试题
介绍一下Linux中的链接
May 28 面试题
Java语言程序设计测试题判断题部分
Jan 06 面试题
既然说Ruby中一切都是对象,那么Ruby中类也是对象吗
Jan 26 面试题
遇到的Mysql的面试题
Jun 29 #面试题
一些关于MySql加速和优化的面试题
Jan 30 #面试题
MYSQL支持事务吗
Aug 09 #面试题
MYSQL基础面试题
May 13 #面试题
mysql有关权限的表都有哪几个
Apr 22 #面试题
介绍一下mysql的日期和时间函数
Mar 28 #面试题
介绍一下MYSQL常用的优化技巧
Oct 25 #面试题
You might like
ftp类(myftp.php)
2006/10/09 PHP
BBS(php & mysql)完整版(六)
2006/10/09 PHP
PHP 数组实例说明
2008/08/18 PHP
PHP 输出URL的快捷方式示例代码
2013/09/22 PHP
TP5框架实现上传多张图片的方法分析
2020/03/29 PHP
网页的标准,IMG不支持onload标签怎么办
2006/06/29 Javascript
Js实现当前点击a标签变色突出显示其他a标签回复原色
2013/11/27 Javascript
js实现身份证号码验证的简单实例
2014/02/19 Javascript
原生javascript实现拖动元素示例代码
2014/09/01 Javascript
浅谈javascript中replace()方法
2015/11/10 Javascript
浅析jQuery移动开发中内联按钮和分组按钮的编写
2015/12/04 Javascript
详解javascript的变量与标识符
2016/01/04 Javascript
js判断上传文件后缀名是否合法
2016/01/28 Javascript
详解微信小程序——自定义圆形进度条
2016/12/29 Javascript
详解基于Bootstrap+angular的一个豆瓣电影app
2017/06/26 Javascript
360doc网站不登录就无法复制内容的解决方法
2018/01/27 Javascript
angular2 NgModel模块的具体使用方法
2019/04/10 Javascript
js 使用ajax设置和获取自定义header信息的方法小结
2020/03/12 Javascript
微信小程序实现页面监听自定义组件的触发事件
2020/11/01 Javascript
[04:16]DOTA2英雄梦之声_第09期_斧王
2014/06/21 DOTA
[01:00:59]VP VS VG Supermajor小组赛胜者组第二轮 BO3第二场 6.2
2018/06/03 DOTA
rhythmbox中文名乱码问题解决方法
2008/09/06 Python
Python实现全角半角转换的方法
2014/08/18 Python
零基础写python爬虫之抓取百度贴吧并存储到本地txt文件改进版
2014/11/06 Python
详解Python的Django框架中Manager方法的使用
2015/07/21 Python
matplotlib绘图实例演示标记路径
2018/01/23 Python
Django中的session用法详解
2020/03/09 Python
荷兰最大的儿童服装店:The Kids Republic
2019/04/13 全球购物
中国梦演讲稿3分钟
2014/08/19 职场文书
党风廉正建设个人工作总结
2015/03/06 职场文书
大客户经理岗位职责
2015/04/09 职场文书
离婚案件答辩状
2015/05/22 职场文书
入党积极分子半年考察意见
2015/06/02 职场文书
Redis缓存-序列化对象存储乱码问题的解决
2021/06/21 Redis
MYSQL如何查看进程和kill进程
2022/03/13 MySQL
Python实战实现爬取天气数据并完成可视化分析详解
2022/06/16 Python