Thursday, November 5, 2009

MySQL Interview Questions

1.Define candidate key, alternate key, composite key?
2.What is the difference between Primary Key and Unique Key?
3.Difference between clustered and non clustered index
4.Difference between HAVING and WHERE clause
5.Explain Normalization and De-normalization
6.What is the difference between inner join and outer join?
7.Which will be faster out of queries with explicit INNER JOIN and implicit one?
8.How to create Indexes in MySQL?
9.How to remove duplicate records from a table?
10.Is it possible to remove a column from a table?
11.How to rename a table in MySQL?
12.Is it possible to do a FULL OUTER JOIN in MySQL?
13.How do you start and stop MySQL on Windows?
14.How do you start MySQL on Linux?
15.What’s the default port for MySQL Server?
16.How do you change a password for an existing user via mysqladmin?
17.How to backup a database in MySQL?
18.Different table types in MySQL?
19.How to repair a MYISAM table?
20.Explain advantages of InnoDB over MyISAM?
21.Explain advantages of MyISAM over InnoDB?
22.What are HEAP tables in MySQL?
23.What are CSV tables?
24.Explain federated tables.
25.If you specify the data type as DECIMAL (5,2), what’s the range of values that can be stored in this table?
26.If I created a column with data type VARCHAR(3), how is it stored in a MySQL table?
27.What does SET SQL_AUTO_IS_NULL =1 do?
29.What is the usage of SAVEPOINTS?
30.What is referential integrity constraint?
31.What is an integrity constraint?
32.What is WITH ROLLUP clause in MySQL?
33.What is difference between TRUNCATE & DELETE?
34.How can we take a backup of a mysql table and how can we restore it. ?
35.How can we optimize or increase the speed of a mysql select query?
36.What are the different tables present in MySQL? Which is the default?
37.How can we encrypt and decrypt a data present in a mysql table using mysql?
38.Given an employee table, how would you find out the second highest salary?
39.Given an employee table, Print the Employee's and their respective Managers.
40.How do you handle MySQL security?
41.What is SQL Injection?
42.How do you perform MySQL query Optimization?