Top 10 Mysql Interview Questions Answers

a minute read

Frequently asked basic and advanced MySql Queries Interview Questions and Answers.

1. What is MySQL? 

MySQL is an open source RDBMS which is built, supported and distributed by MySQL (now acquired by Oracle).

2. What is the Differentiate between FLOAT and DOUBLE ?

FLOAT stores floating point numbers with accuracy up to eight places and has four bytes while DOUBLE stores floating point numbers with accuracy upto 18 places and has eight bytes.

3. What do you mean by % and _ in the LIKE statement ?

% corresponds to 0 or more characters, _ is exactly one character in the LIKE statement.

5. How will you obtain list of all the databases?

To list all currently running databases run the command on mysql shell as: show databases;

6. How do you concatenate strings in MySQL? 

Select CONCAT (firstname,’ ‘, middle_name,’ ‘, lastname)  AS Name From table;

7. What is the difference between mysql_fetch_array and mysql_fetch_object?

mysql_fetch_array() -Returns a result row as an associated array or a regular array from database.

mysql_fetch_object – Returns a result row as object from database.

8. What are HEAP tables in MySQL?

HEAP tables are in-memory. They are usually used for high-speed temporary storage.

No TEXT or BLOB fields are allowed within HEAP tables. You can only use the comparison operators = and <=>.

HEAP tables do not support AUTO_INCREMENT. Indexes must be NOT NULL.

9. How many columns can be used for creating Index?

Maximum of 16 indexed columns can be created for any standard table.

10. Explain advantages of InnoDB over MyISAM?

– Row-level locking, transactions, foreign key constraints and crash recovery.

Facebook Twitter LinkedIn Telegram Whatsapp

Related Posts:

“How to Export MySQL data to Excel in PHP ?” This script will used to export data into .xls format from mysql database.You need to just copy this code and update database connection details. Below code will export mysql data into excel (.xls format) with ever...
How to get second highest or nth maximum salary of an Employee table is one of the most frequently asked Mysql/SQL interview question. PHP Mysql Query Suppose we have the following simple database table called Employee that has 3 columns named Employee ID,Empl...
How to manage international languages in MySQL database using php ? If you want to store multiple languages like Arabic, French, Hindi or Urdu to your MySQL database, default settings is not valid to do that to insert all languages in database. If you insert ...