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

面试题 相关文章推荐
Ibatis中如何提高SQL Map的性能
May 11 面试题
大整数数相乘的问题
Jul 22 面试题
如何判断一段程序是由C 编译程序还是由C++编译程序编译的
Aug 04 面试题
SQL里面IN比较快还是EXISTS比较快
Jul 19 面试题
一套.net面试题及答案
Nov 02 面试题
可以使用抽象函数重写基类中的虚函数吗
Jun 02 面试题
介绍一下write命令
Aug 10 面试题
如何利用find命令查找文件
Feb 07 面试题
一些Solaris面试题
Dec 22 面试题
新锐科技Java程序员面试题
Jul 25 面试题
对象的序列化(serialization)类是面向流的,应如何将对象写入到随机存取文件中
Jun 22 面试题
初级Java程序员面试题
Mar 03 面试题
遇到的Mysql的面试题
Jun 29 #面试题
一些关于MySql加速和优化的面试题
Jan 30 #面试题
MYSQL支持事务吗
Aug 09 #面试题
MYSQL基础面试题
May 13 #面试题
mysql有关权限的表都有哪几个
Apr 22 #面试题
介绍一下mysql的日期和时间函数
Mar 28 #面试题
介绍一下MYSQL常用的优化技巧
Oct 25 #面试题
You might like
百度地图经纬度转换到腾讯地图/Google 对应的经纬度
2015/08/28 PHP
PHP中addcslashes与stripcslashes函数用法分析
2016/01/07 PHP
php 实现进制相互转换
2016/04/07 PHP
Yii框架操作cookie与session的方法实例详解
2019/09/04 PHP
laravel-admin 在列表页添加自定义按钮的例子
2019/09/30 PHP
点击文章内容处弹出页面代码
2009/10/01 Javascript
5秒后跳转效果(setInterval/SetTimeOut)
2013/05/03 Javascript
php与js的区别是什么
2013/08/05 Javascript
js setTimeout 参数传递使用介绍
2013/08/13 Javascript
jquery()函数的三种语法介绍
2013/10/09 Javascript
多种方法实现360浏览器下禁止自动填写用户名密码
2014/06/16 Javascript
理解Angular的providers给Http添加默认headers
2017/07/04 Javascript
原生JS实现图片懒加载之页面性能优化
2019/04/26 Javascript
使用webpack搭建vue环境的教程详解
2019/12/31 Javascript
vue滑动吸顶及锚点定位的示例代码
2020/05/10 Javascript
JavaScript 面向对象程序设计详解【类的创建、实例对象、构造函数、原型等】
2020/05/12 Javascript
OpenLayers加载缩放控件使用方法详解
2020/09/25 Javascript
Python CSV模块使用实例
2015/04/09 Python
python将unicode转为str的方法
2017/06/21 Python
SVM基本概念及Python实现代码
2017/12/27 Python
python 实时得到cpu和内存的使用情况方法
2018/06/11 Python
python之mock模块基本使用方法详解
2019/06/27 Python
Python 随机按键模拟2小时
2020/12/30 Python
基于注解实现 SpringBoot 接口防刷的方法
2021/03/02 Python
css3绘制百度的小度熊
2018/10/29 HTML / CSS
系统管理员的职责包括那些?管理的对象是什么?
2016/09/20 面试题
优秀教师获奖感言
2014/01/31 职场文书
应届生面试求职信
2014/07/02 职场文书
院党委组织查摆问题对照检查材料思想汇报2014
2014/10/08 职场文书
写给领导的感谢信
2015/01/22 职场文书
遗失说明具结保证书
2015/02/26 职场文书
2015入党自荐书范文
2015/03/05 职场文书
感动中国何玥观后感
2015/06/02 职场文书
党员身份证明材料
2015/06/19 职场文书
给校长的建议书作文300字
2015/09/14 职场文书
源码解读Spring-Integration执行过程
2021/06/11 Java/Android