MySQL Interview questions


Total available count: 24
Subject - Databases
Subsubject - MySQL

How MySQL Optimizes DISTINCT?

DISTINCT Optimization. DISTINCT combined with ORDER BY needs a temporary table in many cases. Because DISTINCT may use GROUP BY, learn how MySQL works with columns in ORDER BY or HAVING clauses that are not part of the selected columns.

DISTINCT is converted to a GROUP BY on all columns and it will be combined with the ORDER BY clause.

SELECT DISTINCT t1.a FROM t1,t2 where t1.a=t2.a;

 




Next 5 interview question(s)

1
Where MyISAM table will be stored and also give their formats of storage?
2
What is the difference between mysql_fetch_array and mysql_fetch_object?
3
What is the difference between BLOB AND TEXT?
4
Is Mysql query case sensitive?
5
How can you see all indexes defined for a table?