My-Sql Interview Questions and Answers

What is MySQL ?

MySQL (pronounced 'my ess cue el') is an open source relational database management system (RDBMS) that uses Structured Query Language (SQL), the most popular language for adding, accessing, and processing data in a database. Because it is open source, anyone can download MySQL and tailor it to their needs in accordance with the general public license(http://www.gnu.org). its a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server.

how to list or view all databases from the mysql server?
mysql> show databases;
how to list or view all databases from the mysql server?
mysql> show databases;
How Switch (select or use) to a database?
mysql> use databasename;

How To see all the tables from a database of mysql server?
mysql> show tables;
What are some good ideas regarding user security in MySQL?
There is no user without a password. There is no user without a user name. There is no user whose Host column contains % (which here indicates that the user can log in from anywhere in the network or the Internet). There are as few users as possible (in the ideal case only root) who have unrestricted access.
Explain advantages of InnoDB over MyISAM?
Row-level locking, transactions, foreign key constraints and crash recovery.

Explain advantages of MyISAM over InnoDB?
Much more conservative approach to disk space management - each MyISAM table is stored in a separate file, which could be compressed then with myisamchk if needed. With InnoDB the tables are stored in tablespace, and not much further optimization is possible. All data except for TEXT and BLOB can occupy 8,000 bytes at most. No full text indexing is available for InnoDB.
The Main Features of MySQL?

The following list describes some of the important characteristics of MySQL: 
Fully multi-threaded using kernel threads. That means it can easily use multiple CPUs if available. 
C, C++, Eiffel, Java, Perl, PHP, Python and Tcl APIs. Works on many different platforms. 
Many column types: signed/unsigned integers 1, 2, 3, 4, and 8 bytes long, FLOAT, DOUBLE, CHAR, 
VARCHAR, TEXT, BLOB, DATE, TIME, DATETIME, TIMESTAMP, YEAR, SET, and ENUM types.
Very fast joins using an optimized one-sweep multi-join. Full operator and function support.
Very fast B-tree disk tables with index compression. Up to 32 indexes per table are allowed.
Written in C and C++. Tested with a broad range of different compilers.
A very fast thread-based memory allocation system. 
No memory leaks. Tested with a commercial memory leakage detector (purify). 
Includes myisamchk, a very fast utility for table checking, optimization, and repair.

Latest Updates

Height and Distance

An aeroplane flying at a height of 300 m above the ground passes vertically above another plane at an instant when the angles of elevation of the two planes from the same point on the ground are 60º and 45º respectively. What is the height of the lower plane from the ground?

From the top of a building 90 m high, the angles of depression of the top and the bottom of a tree are 30º and 45º respectively. What is the height of the tree?

Trigonometry

What is the value of sinx √( 1 /1+cosx + 1 /1-cosx ) ?

What is cos4 A - sin4 A / cos2 A - sin2 A equal to?

If 7sin2 x +3cos2 x = 4, 0 < x < 90º ,then what is the value of tan x?

If x = a cosθ + b sinθ and y = a sinθ - b cosθ then what is x2 + y2 equal to?

Average

The mean of 5 numbers is 15. If one more number is included, the mean of the 6 numbers becomes 17. What is the included number?

The mean marks obtained by 300 students in a subject are 60. The mean of top 100 students was found to be 80 and the mean of last 100 students was found to be 50. The mean marks of the remaining 100 students are?

In an asymmetrical distribution, of the mean and median of the distribution are 270 and 220 respectively, then the mode of the data is?

Let a, b, c, d, e, f, g be consecutive even numbers and j, k, l, m, n be consecutive odd numbers. What is the average of all the numbers?

Alligation or Mixture

25 kg of alloy X is mixed with 125 kg of alloy Y. If the amount of lead and tin in the alloy X is the ratio 1 : 2 and the amount of lead and tin in the alloy Y is in the ratio 2 : 3, then what is the ratio of lead to tin in the mixture?

Simplification

The ratio of two numbers is 1 : 5 and their product is 320. What is the difference between the square of these two numbers?

Trigonometry

What is the value of cot 4π/3 ?

Indian Politics

Article-24 of the Indian Constitution ‘Prohibition of employment of children in factories, etc’ deals with?

Article-134A of the Indian Constitution ‘Certificate for appeal to the Supreme Court’ deals with?

Chemistry

Who invented Aspirin?

Physics

A larger force on a rotating body results in larger?

What is the unit of the physical quantity, magnetic flux density?