This page contains the list commonly asked MySQL interview questions and answers. MySQL is an open-source relational database management system (RDBMS) owned by Oracle, though initially owned and sponsored by a single for-profit firm, the Swedish company MYSQLAB. The complete source code of MySQL is accessible under the GNU General Public License terms.
Q1: In which language MySQL is developed?
MySQL is developed in C & C++ and its SQL parser is written in yacc programming language.
Q2: What is Technical Specification of MySQL?
Below are the technical specification of MySQL database:
Q3: How to display the current date and time using MySQL Query?
Use the below MySQL query to display the current date and time:
1 | SELECT NOW(); |
Below query will display only date:
1 | SELECT CURRENT_DATE(); |
Q4: What is limitation to add columns to create for an index?
You can create maximum of 16 indexed columns for a standard MySQL table.
Q5: How do you create an alias in MySQL?
Use the below MySQL query to create an alias in MySQL database:
1 2 3 4 5 6 7 8 9 10 11 12 13 | SELECT t.order_id, orders.customer_id, t.total, orders.order_placed_date FROM # List of all orders and total order values (alias t) ( SELECT order_id, SUM(purchase_price * quantity) AS total FROM products_to_orders GROUP BY order_id ) AS t INNER JOIN orders ON t.order_id = orders.order_id; |
Q6: What is default port for MySQL Server?
The default port of MySQL server is 3306.
Q7: How can you dispaly the all indexes defined for a database table?
Use the below MySQL query to display the all nindexes defined for a database table:
1 | SHOW INDEX FROM <tablename>; |
Q8: What is InnoDB?
The InnoDB is a database storage engine used for the safe database transactions. It was developed by Inno Oy, now Oracle Corporation.
Q9: How many types of JOINS in MySQL?
Below are the list of joins which you can used in MySQL:
1) Inner join
1.1) equi join
1.2) natural join
2)Outer join
2.1)left join
2.2)right join
2.3) full join
3) Cross join
Q10: How to get only the distinict columns values in MySQL?
Use the MySQL query to get only the distinict columns values from table:
1 | SELECT DISTINCT column_name FROM table_name ; |
Q11: How many TRIGGERS are possible in MySQL?
There are six type of triggers to use in MySQL database table.
Q12: How to concatenate two fields in MySQL?
Use the below MySQL query to concatenate two fields in MySQL:
1 | SELECT CONCAT(column1,column2) FROM table_name |
Q13: List out the storage engines which MySQL support?
Below is the list of storage engines which MySQL support:
Q14: How do you get a portion of a string?
Use the below MySQL query to get a portion of a string:
1 | SELECT SUBSTR(name, 1, 10) from questions; |
Q15: How do you convert a string to UTF-8?
Use the below MySQL query to convert a string to UTF-8 using MySQl query:
1 | SELECT (question USING utf8); |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.