Skip to content

Latest commit

 

History

History
49 lines (34 loc) · 1.09 KB

基础.md

File metadata and controls

49 lines (34 loc) · 1.09 KB

max avg 函数可以使用到索引吗

left join中一定是左表驱动右表么

count(*)、count(1)、count(id)、count(field)有什么区别,请简述count在innodb和mysql中的实现原理

请简述5.6、5.7中如下sql的执行流程

//index key (name)
SELECT  * FROM  demo
    WHERE  name > "a" AND name like "%b"

请简述如下几种子查询的执行流程

SELECT * FROM s1 
    WHERE key1 = (SELECT common_field FROM s2 WHERE key3 = 'a' LIMIT 1);
    
SELECT * FROM s1 WHERE 
    key1 = (SELECT common_field FROM s2 WHERE s1.key3 = s2.key3 LIMIT 1);
    
SELECT * FROM s1 
    WHERE key1 IN (SELECT common_field FROM s2 WHERE key3 = 'a');
    

SELECT * FROM s1 
    WHERE key1 IN (SELECT common_field FROM s2 WHERE s1.key3 = s2.key3);
    

请简述如下几种排序的执行流程

//index key (uid)
SELECT * FROM demo 
    ORDER BY uid
    
SELECT * FROM demo 
    ORDER BY uid LIMIT 10

请问如下sql mysql执行时候会排序么

//index key (city,name)
SELECT * FROM demo 
    WHERE city IN("杭州"、"苏州") ORDER BY name LIMIT 100