康希诺生物股份公司5月招聘面试题70道2020523

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

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

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

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

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


正确答案:B


Which three statements are true about memory buffer allocation by a MySQL Server?()

A.Global buffers such as the InnoDB buffer pool are allocated after the server starts, and are never freed

B.Thread buffers are allocated when a client connects, and are freed when the client disconnects

C.Buffers that are needed for certain operation are allocated when the operation starts, and freed when it ends

D.User buffers are allocated at server startup and freed when the user is dropped

E.All dynamic buffers that are set with a SET GLOBAL statement immediately get allocated globally, and are never freed


参考答案:A, B, C


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:跨域请求问题django怎么解决的(原理)?可用的回答 : 1. 启用中间件 2. post请求 3. 验证码 4. 表单中添加%csrf_token%标签 问题 Q3:写爬虫使用多进程好,还是用多线程好?可用的回答 : IO密集型代码(文件处理、网络爬虫等), 多线程能够有效提升效率(单线程下有IO操作会进行IO等待,造成不必要的时间浪费,而开启多线程能在线程A等待时,自动切换到线程B,可以不浪费CPU的资源,从而能提升程序执行效率)。 在实际的数据采集过程中,既考虑网速和响应的问题,也需要考虑自身机器的硬件情况,来设置多进程或多线程 问题 Q4:遇到过得反爬虫策略以及解决方法?可用的回答 : 反爬虫策略: 1.通过headers反爬虫 2.基于用户行为的发爬虫(同一IP短时间内访问的频率,封IP) 3.动态网页反爬虫(通过ajax请求数据,或者通过JavaScript生成) 4.对部分数据进行加密处理的(数据是乱码) 解决方法: 1. 对于基本网页的抓取可以自定义headers,添加headers的数据 2. 使用多个代理ip进行抓取或者设置抓取的频率降低一些, 3. 动态网页的可以使用selenium + phantomjs 进行抓取 4. 对部分数据进行加密的,可以使用selenium进行截图,使用python自带的pytesseract库进行识别,但是比较慢最直接的方法是找到加密的方法进行逆向推理。 问题 Q5:什么是局域网和广域网?可用的回答 : 局域网:(Local Area Network,LAN), 局域网是一个局部范围的计算计组, 比如家庭网络就是一个小型的局域网,里面包含电脑、手机和平板等,他们共同连接到你家的路由器上。 又比如学校的机房就是一个局域网,里面有几百几千台电脑, 当机房无法上外网时,但是电脑之间仍可以通信,你们可以通过这个局域网来打CS 、玩红警。 理论上,局域网是封闭的,并不可以上外网,可以只有两台电脑,也可以有上万台。 广域网:(WAN,Wide Area Network),广域网的范围就比较大了, 可以把你家和别人家、各个省、各个国家连接起来相互通信。 广域网和局域网都是从范围的角度来划分的, 广域网也可以看成是很多个局域网通过路由器等相互连接起来。 问题 Q6:是否使用过functools中的函数?其作用是什么?可用的回答 :python自带的 functools 模块提供了一些常用的高阶函数,也就是用于处理其它函数的特殊函数。换言之,就是能使用该模块对可调用对象进行处理。functools.cmp_to_key(func)functools.total_ordering(cls)functools.reduce(function, iterable, initializer)functools.partial(func, args, *keywords)functools.update_wrapper(wrapper, wrapped, assigned, updated)functools.wraps(wrapped, assigned, updated)问题 Q7:python提供的内置类型是什么?可用的回答 : 可变类型的内置类型: List Sets Dictionaries 不可变的内置类型: Strings Tuples Numbers 问题 Q8:简述 OSI 七层协议?可用的回答 : OSI是Open System Interconnection的缩写,意为开放式系统互联。 OSI七层协议模型主要是: 1. 应用层(Application) 应用层 是最靠近用户的OSI层。这一层为用户的应用程序(例如电子邮件、文件传输和终端仿真)提供网络服务。 2. 表示层(Presentation) 表示层 可确保一个系统的应用层所发送的信息可以被另一个系统的应用层读取。 例如,PC程序与另一台计算机进行通信,其中一台计算机使用扩展二一十进制交换码(EBCDIC),而另一台则使用美国信息交换标准码(ASCII)来表示相同的字符。 如有必要,表示层会通过使用一种通格式来实现多种数据格式之间的转换。 3. 会话层(Session) 会话层 通过

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

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月招聘面试题70道2020523” 相关考题
考题 You want to start monitoring statistics on the distribution of storage engines that are being used and the average sizes of tables in the various databases. Some details are as follows: The Mysql instance has 400 databases. Each database on an average consists of 25-50 tables. You use the query: SELECT TABLE_SCHEMA, 'ENGINE', COUNT (*), SUM(data_length) total_size FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE= 'BASE TABLE' GROUP BY TABLE_SCHEMA, 'ENGINE' ; Why is this query slow to execute?()A、Collecting information requires large numbers of locks on various INFORMATION_SCHEMA tablesB、Aggregating details from various storage engine caches for the final output is time consumingC、Collecting information requires various disk-level operations and is time consumingD、Counting and summarizing all table pages in the InnoDB shared tablespace is time consuming正确答案:C

考题 多选题Which two statements are true about InnoDB auto-increment locking?()AThe auto-increment lock can be a table-level lockBInnoDB never uses table-level locksCSome settings for innodb_autoinc_lock_mode can help reduce lockingDInnoDB always protects auto-increment updates with a table-level lock正确答案:C,D解析:暂无解析

考题 多选题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解析:暂无解析

考题 多选题Full Atomicity, Consistency, Isolation, Durability (ACID) compliance is a necessity for a new application, which heavily reads and writes data. This requires the following config file options: Sync_binlog=1 Innodb_flush_log_at_trx_commit=1 Innodb_doublewrite=1 However, this configuration is expected to introduce disk I/O overhead. What three changes will reduce disk I/O overheads?()AUse of soft links for database directories on the same physical diskBUse of delay_key_write=ON for batch index updateCAllocation of RAM to the buffer pool such that more of the data can fit in RAMDPlacement of InnoDB log files and datadir on separate physical disksEUse of separate directories on the same physical disk for log files and data files正确答案:D,E解析:暂无解析

考题 What is true regarding InnoDB locking?()A、InnoDB uses row and table-level locks, but row locks are not escalatesB、InnoDB locks only those rows that are updatedC、InnoDB only uses row locks, not page or table-level locksD、InnoDB row locks may be escalated to page or table-level locksE、InnoDB uses row-level or table-level locks depending on the number of rows affected正确答案:B

考题 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

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

考题 问答题简述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特性(例如外键)的表不适用。解析:暂无解析

考题 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

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