By default, MySQL sorts all GROUP BY col1, col2, ... queries as if you specified ORDER BY col1, col2, ... in the query as well. If you include an explicit ORDER BY clause that contains the same column list, MySQL optimizes it away without any speed penalty, although the sorting still occurs. If a query… Continue reading MySql – Order BY NULL;
Depends on the database server. MySQL doesn't care, its basically the same thing. In MySQL, physically, a schema is synonymous with a database. You can substitute the keyword SCHEMA instead of DATABASE in MySQL SQL syntax, for example using CREATE SCHEMA instead of CREATE DATABASE. Some other database products draw a distinction. For example, in… Continue reading Schema vs Database
Docs https://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks-handling.html shared lock A kind of lock that allows other transactions to read the locked object, and to also acquire other shared locks on it, but not to write to it. The opposite of exclusive lock. shared (S) lock exclusive lock A kind of lock that prevents any other transaction from locking the same row.… Continue reading Mysql Deadlock
The CHAR and VARCHAR types are similar, but differ in the way they are stored and retrieved. They also differ in maximum length and in whether trailing spaces are retained. The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example, CHAR(30) can… Continue reading Char vs Varchar – Mysql
How to figure out if mysql index fits entirely in memory ? MySQL - why not index every field? What is the recommended value of key_buffer_size in MySQL? B+ Tree - Read the comment section as well.