MySQL face questions highlights, allegedly well-known Internet companies are using!

MySQL face questions highlights, allegedly well-known Internet companies are using!

MySQL face questions highlights, allegedly well-known Internet companies are using


Preface:

In the database usage survey in the first half of this year, we collected a large number of well-known Internet company's database usage, where foreign GitHub, Airbnb, Yelp, Coursera are using MySQL database, Alibaba China, where to network, Tencent Meizu, some key business Jingdong also uses MySQL database. At the same time, but also many MySQL database ranking first single, the first-tier developers and Internet companies are using open-source database, you know how much? The MySQL self-test volumes, how much will you do?

1, a table, which has increment primary key ID, when the insert 17 records, delete records 15, 16, the article, then Mysql restart, and then insert a record, this record ID 18 or 15?

MySQL face questions highlights, allegedly well-known Internet companies are using



2, MySQL technology is characterized by what?

MySQL database software is a client or server system, including: support for a variety of client programs and libraries of multi-threaded SQL server, different back-end, a wide range of application programming interfaces and management tools.

3. What Heap tables are?

HEAP table exists in memory for temporarily storing high speed.

BLOB or TEXT field is not allowed

Only use comparison operators =, <,>, =,>, = <

HEAP tables do not support AUTO_INCREMENT

Index can not be NULL

4, MySQL server What is the default port?

MySQL server default port is 3306.

5, compared with Oracle, MySQL What are the advantages?

MySQL is open source software, available at any time, without charge.

MySQL is portable

GUI with the command prompt.

Use MySQL Query Browser Support Management

6, how to distinguish between FLOAT and DOUBLE?

The following is the difference between the FLOAT and DOUBLE:

Floating point numbers are stored in 8-bit precision FLOAT, and four bytes.

DOUBLE stored in the floating-point, 18-bit accuracy, eight bytes.

7, the distinction between CHAR_LENGTH and LENGTH?

CHAR_LENGTH is the number of characters, LENGTH is the number of bytes. Latin two data characters are the same, but for other Unicode encoding, they are different.

8、请简洁描述MySQL中InnoDB支持的四种事务隔离级别名称,以及逐级之间的区别?

SQL标准定义的四个隔离级别为:

read uncommited :读到未提交数据

read committed:脏读,不可重复读

repeatable read:可重读

serializable :串行事物

MySQL face questions highlights, allegedly well-known Internet companies are using



9、在MySQL中ENUM的用法是什么?

ENUM是一个字符串对象,用于指定一组预定义的值,并可在创建表时使用。

Create table size(name ENUM('Smail,'Medium','Large');

10、如何定义REGEXP?

REGEXP是模式匹配,其中匹配模式在搜索值的任何位置。

11、CHAR和VARCHAR的区别?

以下是CHAR和VARCHAR的区别:

CHAR和VARCHAR类型在存储和检索方面有所不同

CHAR列长度固定为创建表时声明的长度,长度值范围是1到255

当CHAR值被存储时,它们被用空格填充到特定长度,检索CHAR值时需删除尾随空格。

12、列的字符串类型可以是什么?

字符串类型是:

SET

BLOB

ENUM

CHAR

TEXT

VARCHAR

13、如何获取当前的MySQL版本?

SELECT VERSION();用于获取当前MySQL的版本。

14、MySQL中使用什么存储引擎?

存储引擎称为表类型,数据使用各种技术存储在文件中。

技术涉及:

Storage mechanism

Locking levels

Indexing

Capabilities and functions.

15、MySQL驱动程序是什么?

以下是MySQL中可用的驱动程序:

PHP驱动程序

JDBC驱动程序

ODBC驱动程序

CWRAPPER

PYTHON驱动程序

PERL驱动程序

RUBY驱动程序

CAP11PHP驱动程序

Ado.net5.mxj

16、TIMESTAMP在UPDATE CURRENT_TIMESTAMP数据类型上做什么?

创建表时TIMESTAMP列用Zero更新。只要表中的其他字段发生更改,UPDATE CURRENT_TIMESTAMP修饰符就将时间戳字段更新为当前时间。

17、主键和候选键有什么区别?

表格的每一行都由主键唯一标识,一个表只有一个主键。

主键也是候选键。按照惯例,候选键可以被指定为主键,并且可以用于任何外键引用。

18、如何使用Unix shell登录MySql?

我们可以通过以下命令登录:

# [mysql dir]/bin/mysql -h hostname -u <UserName> -p <password>

19、 myisamchk是用来做什么的?

它用来压缩MyISAM表,这减少了磁盘或内存使用。

20、MYSQL数据库服务器性能分析的方法命令有哪些?

MySQL face questions highlights, allegedly well-known Internet companies are using



21、如何控制HEAP表的最大尺寸?

Heal表的大小可通过称为max_heap_table_size的MySQL配置变量来控制。

22、MyISAM Static和MyISAM Dynamic有什么区别?

在MyISAM Static上的所有字段有固定宽度。动态MyISAM表将具有像TEXT,BLOB等字段,以适应不同长度的数据类型。

MyISAM Static在受损情况下更容易恢复。

23、federated表是什么?

federated表,允许访问位于其他服务器数据库上的表。

24、如果一个表有一列定义为TIMESTAMP,将发生什么?

每当行被更改时,时间戳字段将获取当前时间戳。

25、列设置为AUTO INCREMENT时,如果在表中达到最大值,会发生什么情况?

它会停止递增,任何进一步的插入都将产生错误,因为密钥已被使用。

26、怎样才能找出最后一次插入时分配了哪个自动增量?

LAST_INSERT_ID将返回由Auto_increment分配的最后一个值,并且不需要指定表名称。

27、你怎么看到为表格定义的所有索引?

索引是通过以下方式为表格定义的:

SHOW INDEX FROM <tablename>;

28., LIKE declaration% and _ What does this mean?

It corresponds to 0% or more characters, a character just _ LIKE statement.

29, how to convert between Unix and MySQL timestamp?

UNIX_TIMESTAMP is converted from MySQL timestamp Unix timestamp command

FROM_UNIXTIME is converted from Unix timestamp for MySQL timestamp command

30, column comparing what the operator is?

SELECT statement used in the comparison column =, <>, <=, <,> =,>, <<, >>, <=>, AND, OR, or LIKE operator.

31, how do we get the number of rows affected by a query?

32, Mysql query is case-sensitive?

33., LIKE and REGEXP operations What is the difference?

34., BLOB and TEXT What is the difference?

35. What is the difference between mysql_fetch_array and mysql_fetch_object?

36, how we run in batch mode in mysql?

37, MyISAM tables will be where to store, and also provides its storage format?

38. What are the different tables in MySQL have?

39, ISAM What is that?

40, what InnoDB that?

41, MySQL how to optimize DISTINCT?

42, how to enter characters for the hexadecimal digits?

43, how to display the first 50 lines?

44, how many columns you can use to create an index?

45, NOW () and CURRENT_DATE () What is the difference?

46, what kind of objects can be created using the CREATE statement?

47., MySql table allows the number of TRIGGERS?

48, what is non-standard string type?

49, what is the generic SQL function?

50, explaining the access control list

End:

Due to space limitations, only thirty bands answers in the article, after the interview answers can be added to my learning exchange group 778 477 315 ​​you can get free oh

There are more free Java architecture learning materials, covering all aspects of the Internet, the problems encountered in a variety of products during various scenes, we hope to help expand their breadth of technology and knowledge.

Remember to focus on me oh, will occasionally presented benefits, including consolidation of interview questions, learning materials, source code, etc. ~ ~


Guess you like

Origin blog.51cto.com/14456091/2428161