北京合众思壮科技股份有限公司5月招聘面试题198道202054

在MySQL数据库中,对作为临时存放查询的中间结果集的存储引擎描述正确的是()。

A.始终使用Memory作为临时存放查询的中间结果集

B.默认使用InnoDB作为临时存放查询的中间结果集

C.如果中间结果集含有TEXT或BLOB列的类型字段,则MySQL数据库会将其转换到MylSAM存储引擎表而存放到磁盘中

D.默认使用MylSAM作为临时存放查询的中间结果集


正确答案:B


Which three are properties of the MyISAM storage engine?()

A.Transaction support

B.FULLTEXT indexing for text matching

C.Table and page level locking support

D.Foreign key support

E.Geospatial indexing

F.HASH index support

G.Table level locking only


参考答案:B, E, G


What is true regarding InnoDB locking?()

A.InnoDB uses row and table-level locks, but row locks are not escalates

B.InnoDB locks only those rows that are updated

C.InnoDB only uses row locks, not page or table-level locks

D.InnoDB row locks may be escalated to page or table-level locks

E.InnoDB uses row-level or table-level locks depending on the number of rows affected


参考答案:B


The InnoDB engine has a feature known as clustered indexes.Which three statements are true about clustered indexes as used in InnoDB?()

A.A primary key must exist for creation of a clustered index

B.A clustered index allows fulltext searching within InnoDB

C.The first unique index is always used as a clustered index and not a primary key

D.A clustered index provides direct access to a page containing row data

E.If no indexes exist, a hidden clustered index is generated based on row IDs

F.A primary key is used as a clustered index

G.A clustered index is a grouping of indexes from different tables into a global index for faster searching


参考答案:D, E, F


Which two statements are true about InnoDB auto-increment locking?()

A.The auto-increment lock can be a table-level lock

B.InnoDB never uses table-level locks

C.Some settings for innodb_autoinc_lock_mode can help reduce locking

D.InnoDB always protects auto-increment updates with a table-level lock


参考答案:A, C


北京合众思壮科技股份有限公司5月招聘面试题面试题面试官常问到的一些题目整理如下:问题 Q1:你常用的mysql引擎有哪些?各引擎间有什么区别?可用的回答 : 主要 MyISAM 与 InnoDB 两个引擎,其主要区别如下: 一、 InnoDB 支持事务,MyISAM 不支持,这一点是非常之重要。 事务是一种高级的处理方式,如在一些列增删改中只要哪个出错还可以回滚还原,而 MyISAM就不可以了; 二、 MyISAM 适合查询以及插入为主的应用,InnoDB 适合频繁修改以及涉及到安全性较高的应用; 三、 InnoDB 支持外键,MyISAM 不支持; 四、 MyISAM 是默认引擎,InnoDB 需要指定; 五、 InnoDB 不支持 FULLTEXT 类型的索引; 六、 InnoDB 中不保存表的行数,如 select count(*) from table 时,InnoDB; 需要扫描一遍整个表来计算有多少行,但是 MyISAM 只要简单的读出保存好的行数即可。 注意的是,当 count(*)语句包含 where 条件时 MyISAM 也需要扫描整个表; 七、 对于自增长的字段,InnoDB 中必须包含只有该字段的索引,但是在 MyISAM 表中可以和其他字段一起建立联合索引; 八、 清空整个表时,InnoDB 是一行一行的删除,效率非常慢。MyISAM 则会重建表; 九、 InnoDB 支持行锁(某些情况下还是锁整表,如 update table set a=1 where user like %lee% 问题 Q2:什么是Python中的迭代器?可用的回答 :在Python中,迭代器用于迭代一组元素,如列表之类的容器。问题 Q3:参数如何通过值或引用传递?可用的回答 :Python中的所有内容都是一个对象,所有变量都包含对象的引用问题 Q4:说说什么是爬虫协议?可用的回答 : Robots协议(也称为爬虫协议、爬虫规则、机器人协议等)也就是robots.txt, 网站通过robots协议告诉搜索引擎哪些页面可以抓取,哪些页面不能抓取。 Robots协议是网站国际互联网界通行的道德规范,其目的是保护网站数据和敏感信息、确保用户个人信息和隐私不被侵犯。因其不是命令,故需要搜索引擎自觉遵守。 问题 Q5:简述一下scrapy的基本流程?可用的回答 : scrapy分为9个步骤: 1. Spiders需要初始的start_url或则函数stsrt_requests,会在内部生成Requests给Engine; 2. Engine将requests发送给Scheduler; 3. Engine从Scheduler那获取requests,交给Download下载; 4. 在交给Dowmload过程中会经过Downloader Middlewares(经过process_request函数); 5. Dowmloader下载页面后生成一个response,这个response会传给Engine,这个过程中又经过了Downloader Middlerwares(经过process_request函数),在传送中出错的话经过process_exception函数; 6. Engine将从Downloader那传送过来的response发送给Spiders处理,这个过程经过Spiders Middlerwares(经过process_spider_input函数); 7. Spiders处理这个response,返回Requests或者Item两个类型,传给Engine,这个过程又经过Spiders Middlewares(经过porcess_spider_output函数); 8. Engine接收返回的信息,如果使Item,将它传给Items Pipeline中;如果是Requests,将它传给Scheduler,继续爬虫; 9. 重复第三步,直至没有任何需要爬取的数据 问题 Q6:跨域请求问题django怎么解决的(原理)?可用的回答 : 1. 启用中间件 2. post请求 3. 验证码 4. 表单中添加%csrf_token%标签 问题 Q7:什么是序列化和非序列化?可用的回答 :Pickle模块接受任何Python对象并将其转换为字符串表示形式,并使用dump函数将其转储到文件中,此过程称为pickling。从存储的字符串表示中检索原始Python对象的过程称为unpickling问题 Q8:用尽量多的方法实现单例模式?可用的回答 : 一、模块单例 Python 的模块就是天然的单例模式,因为模块在第一次导入时,会生成.pyc文件,当第二次导入时,就会直接加载.pyc文件,而不会再次执行模块代码。 二、静态变量方法 先执行了类的_new_方法(我们没写时,默认调用object._new_),实例化对象; 然后再执行类的_init_方法,对这个对象进行初始化,所有我们可以基于这个,实现单例模式。 class Singleton(object): def _new_(cls,a): if not hasattr(cls, _instance): cls._instance = object._new_(cls) return cls._instance def _init_(self,a): self.a = a 问题 Q9:什么是Python中的迭代器?可用的回答 :在Python中,迭代器用于迭代一组元素,如列表之类的容器。问题 Q10:Django 和 Flask 之间有什么区别?可用的回答 :Flask是一个“微框架”,主要用于具有更简单要求的小型应用程序。在Flask中,必须使用外部库。Django也可以用于更大的应用程序。它包括一个ORM。算法题面试官常问到的一些算法题目整理如下(大概率会机考):算题题 A1:实现StrStr()算题题 A1:从数据流中找中位数题目描述如下:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle

关于常见的存储引擎,下面描述错误的是_____________。

A.InnoDB存储引擎虽然不支持事件处理应用程序,但是支持外键、同时还支持崩溃修复能力和并发控制

B.MEMORY存储引擎的所有数据都存储在内存中,数据的处理速度快但安全性不高

C.MyISAM存储引擎提供了高速的存储与检索和全文探索能力,它并不支持事务处理应用程序

D.除了InnoDB、MOMORY和MyISAM存储引擎外,MRG_MYISAM、BLACKHOLE和CSV也是MySQL数据库的存储引擎


参考答案:A


在Mysql数据库下,以下哪个选项最好地描述了InnoDB表为什么需要主键并且主键应当尽量短?()

A.因为InnoDB在一个日志中保存到所有主键的指针,短的主键使日志小

B.因为InnoDB使用主键定位二级索引,短的主键使查询快

C.因为InnoDB使用主键定位表记录,短的主键使查询快

D.因为InnoDB使用主键定位表,短的主键使查询快


参考答案:C


关于myisamchk工具,以下描述正确的有哪些?()

A.它能检查MyISAM表

B.它能修复MyISAM表

C.它能获取MyISAM表的信息

D.它能优化MyISAM表


参考答案:ABCD


mysql 参照表和被参照表可以是同一个表吗?

长久以来,流行工具开源RDBMSMySQL并没有支持外键,最近MySQL的不同版本都通过新InnoDB列表引擎支持外键。为了建立两个MySQL表之间的一个外键关系,MySQL创建关联表必须满足以下三种情况:

* 两个表必须是InnoDB表类型。 

* 使用在外键关系的域必须为索引型(Index)。 

* 使用在外键关系的域必须与数据类型相似。


例子.

CREATE TABLE  DEPT (
  id  INT  PRIMARY KEY,
  name  varchar(10),
  pid INT
) ENGINE=InnoDB ;


ALTER TABLE DEPT
   ADD CONSTRAINT DEPT_cons
   FOREIGN KEY (pid)
   REFERENCES  DEPT(id);

下面是插入数据的结果.

mysql> INSERT INTO DEPT VALUES(1, '总公司', NULL);
Query OK, 1 row affected (0.04 sec)

mysql> INSERT INTO DEPT VALUES(2, '分公司', 1);
Query OK, 1 row affected (0.11 sec)

mysql> INSERT INTO DEPT VALUES(3, '办事处', 2);
Query OK, 1 row affected (0.08 sec)

mysql>
mysql> INSERT INTO DEPT VALUES(4, '非法数据', 5);
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`dept`,
CONSTRAINT `DEPT_cons` FOREIGN KEY (`pid`) REFERENCES `dept` (`id`))
mysql>

希望能帮到你,别忘了采纳我的答案哦,祝你生活愉快!



简述MyISAM与innoDB存储引擎有何差别?


正确答案: A.两者在文件构成上有区别;
B.InnoDB支持事务处理,MyISAM不支持;
C.对无WHERE子句的COUNT(*)操作的不同:MyISAM中保存了该值,直接读取,InnoDB需要作全表扫描;
D.锁的区别:InnoDB支持表级锁和行级锁,MyISAM只支持表级锁;
E.索引会缓存数据,而MYISAM不会;
F.INNODB不区分char和varchar;
G.INNODB支持hash索引,而MYISAM不支持;
H.InnoDB不支持FULLTEXT类型的索引;
I.InnoDB 中不保存表的具体行数,也就是说,执行select count(*) from table时,InnoDB要扫描一遍整个表来计算有多少行,但是MyISAM只要简单的读出保存好的行数即可。注意的是,当count(*)语句包含
W.here条件时,两种表的操作是一样的;
J.对于AUTO_INCREMENT类型的字段,InnoDB中必须包含只有该字段的索引,但是在MyISAM表中,可以和其他字段一起建立联合索引;
K.DELETE FROM table时,InnoDB不会重新建立表,而是一行一行的删除;
L.LOAD TABLE FROM
M.ASTER操作对InnoDB是不起作用的,解决方法是首先把InnoDB表改成MyISAM表,导入数据后再改成InnoDB表,但是对于使用的额外的InnoDB特性(例如外键)的表不适用。

更多 “北京合众思壮科技股份有限公司5月招聘面试题198道202054” 相关考题
考题 多选题关于myisamchk工具,以下描述正确的有哪些?()A它能检查MyISAM表B它能修复MyISAM表C它能获取MyISAM表的信息D它能优化MyISAM表正确答案:C,A解析:暂无解析

考题 问答题简述MyISAM与innoDB存储引擎有何差别?正确答案:A.两者在文件构成上有区别;B.InnoDB支持事务处理,MyISAM不支持;C.对无WHERE子句的COUNT(*)操作的不同:MyISAM中保存了该值,直接读取,InnoDB需要作全表扫描;D.锁的区别:InnoDB支持表级锁和行级锁,MyISAM只支持表级锁;E.索引会缓存数据,而MYISAM不会;F.INNODB不区分char和varchar;G.INNODB支持hash索引,而MYISAM不支持;H.InnoDB不支持FULLTEXT类型的索引;I.InnoDB 中不保存表的具体行数,也就是说,执行select count(*) from table时,InnoDB要扫描一遍整个表来计算有多少行,但是MyISAM只要简单的读出保存好的行数即可。注意的是,当count(*)语句包含W.here条件时,两种表的操作是一样的;J.对于AUTO_INCREMENT类型的字段,InnoDB中必须包含只有该字段的索引,但是在MyISAM表中,可以和其他字段一起建立联合索引;K.DELETE FROM table时,InnoDB不会重新建立表,而是一行一行的删除;L.LOAD TABLE FROMM.ASTER操作对InnoDB是不起作用的,解决方法是首先把InnoDB表改成MyISAM表,导入数据后再改成InnoDB表,但是对于使用的额外的InnoDB特性(例如外键)的表不适用。解析:暂无解析

考题 Which three are properties of the MyISAM storage engine?()A、Transaction supportB、FULLTEXT indexing for text matchingC、Table and page level locking supportD、Foreign key supportE、Geospatial indexingF、HASH index supportG、Table level locking only正确答案:B,E,G

考题 多选题The InnoDB engine has a feature known as clustered indexes. Which three statements are true about clustered indexes as used in InnoDB?()AA primary key must exist for creation of a clustered indexBA clustered index allows fulltext searching within InnoDBCThe first unique index is always used as a clustered index and not a primary keyDA clustered index provides direct access to a page containing row dataEIf no indexes exist, a hidden clustered index is generated based on row IDsFA primary key is used as a clustered indexGA clustered index is a grouping of indexes from different tables into a global index for faster searching正确答案:D,E,F解析:暂无解析

考题 The InnoDB engine has a feature known as clustered indexes. Which three statements are true about clustered indexes as used in InnoDB?()A、A primary key must exist for creation of a clustered indexB、A clustered index allows fulltext searching within InnoDBC、The first unique index is always used as a clustered index and not a primary keyD、A clustered index provides direct access to a page containing row dataE、If no indexes exist, a hidden clustered index is generated based on row IDsF、A primary key is used as a clustered indexG、A clustered index is a grouping of indexes from different tables into a global index for faster searching正确答案:D,E,F

考题 You have table 'apps','userdata' on server that uses MyISAM storage engine. You want to transfer this data to server but use InnoDB engine instead. You execute the following commands: ServerB commands: Shell> mysqldump –u root –h server –no-data apps userdata | mysql –u root –p apps Shell> mysql –u root –p –h server –e 'ALTER TABLE 'apps','userdata' ENGINE=InnoDB;' Shell> mysqldump –u root –p –h server –no-create-info –order-by-primary apps userdata | mysql –u root –p apps What effect does the – order-by-primary argument have on the mysqldump command?()A、It exports tables with the most indexes first to assist with import speedsB、It ensures that unique indexes have no conflicts when the data is dumpedC、It orders by primary key to assist in speeding up importing to InnoDB tablesD、It must be specified so index data is dumped correctly when –on-create-info is used正确答案:C

考题 多选题What are two methods of taking a binary backup of a Mysql Server using InnoDB storage engine?()AFile system snapshotsBMysqldumpslowCMysqlhotcopyDMysqldump with – binary-data optionEMysql Enterprise Backup正确答案:C,B解析:暂无解析

考题 多选题Which three statements are true about memory buffer allocation by a MySQL Server?()AGlobal buffers such as the InnoDB buffer pool are allocated after the server starts, and are never freedBThread buffers are allocated when a client connects, and are freed when the client disconnectsCBuffers that are needed for certain operation are allocated when the operation starts, and freed when it endsDUser buffers are allocated at server startup and freed when the user is droppedEAll dynamic buffers that are set with a SET GLOBAL statement immediately get allocated globally, and are never freed正确答案:A,B解析:暂无解析

考题 关于myisamchk工具,以下描述正确的有哪些?()A、它能检查MyISAM表B、它能修复MyISAM表C、它能获取MyISAM表的信息D、它能优化MyISAM表正确答案:A,B,C,D

考题 Following a server crash, the automatic recovery of InnoDB fails. How would you begin to manually repair the InnoDB tables?()A、Start the server with the – innodb_recover_options option set to FORCEB、Start the server with the – innodb_force_recovery option set to a non-zero valueC、Start the server as usual, and then execute the REPAIR TABLE commandD、Start the server as usual, and then execute the CHECK TABLE command正确答案:B