MySQL is an open source software to manage database . It is very popular database management software . This article is very useful for those person who is interviewing for database administrator . In this article i will cover 30 basic MySQL interview question for database administrator . Most of the companies uses MySQL database . Please go through 30 Basic MySQL Interview Question for Database Administrator question with their answer before attending the interview
30 Basic MySQL Interview Question for Database Administrator
1. What is MySQL ?
ans. MySQL is an open source RDBMS which is created by MySQL AB . It is now owned by oracle .
2. What is the default port of MySQL server ?
ans. The default port of MySQL server is 3306
3. How would you check status of MySQL service ?
ans. We can check status of MySQL service with the command
# service mysqld status
4. How would you start or stop MySQL service ?
ans. We can start or stop MySQL service with the command
# service mysqld start
# service mysqld stop
5. How would you login to MySQL server from linux operating system ?
ans. To login MySQL server from linux operating system , we use command
# mysql -u root -p
6. How you will check all databases on server ?
ans. To list all databases on server , we use command
7. How you can switch from one database to another ?
ans. use database_name
8. How will you delete a table from database ?
ans. drop table table_name
9. How will you delete a database ?
ans. drop database database_name
10. What is DDL , DML and DCL ?
ans. DDL – It is abbreviation for Data Definition Language dealing with database schema and descriptions of how data resides in database . example – CREATE TABLE command .
DML – It stands for Data Manipulation Language . It includes most common SQL statement such as SELECT , INSERT
DCL – It stands for Data Control Language . It include commands related to permission and control . Example GRANT , REVOKE etc.
11. Which command you use to take dump of MySQL database ?
12. What is difference between SQL and MySQL ?
ans. SQL is known as Structured Query Language , Which is used to interact database. Where as MySQL is a database that stores various type of data .
13. Is MySQL query is case sensitive ?
14. Which command is used to view the content of the table in MySQL ?
15. What is difference between FLOAT and DOUBLE ?
ans. Numbers are stored in FLOAT with eight place accuracy and it has 4 bytes. Where as DOUBLE has 8 bytes and 16 place accuracy .
16. What is a Primary key ?
ans. A primary key is a column whose values uniquely identify every row in table. The primary key value can not be null. Every row must have a primary key value .
17. How do you change a password for existing user via mysqladmin ?
ans. mysqladmin -u root -p password “newpassword”
18. How to get all employee details from employee table ?
ans. select * from employee
19. How to get all employee details from employee table order by first_name descending ?
ans. select * from employee order by first_name desc
20. What are the types of storage engine in MySQL ?
ans . MyISAm , Heap , Merge , INNO DB , ISAM
21. What is trigger in MySQL ?
ans. A trigger is a set of codes that executes in response of some event .
22. What are the disadvantage of MySQL ?
ans. MySQL is not so efficient for large scale database and transaction are not handled efficiently .
23. What is the use of mysql_close() ?
ans. It can be used to close connection opened by mysql_connect() function .
24. How to update database permission or privileges ?
ans. flush privileges
25. How will you get list of all tables in database ?
ans. To get list of all tables in database use command as : show tables
26. In which language MySQL is written ?
ans. MySQL is written in C and C++
27. What is the use of ENUM in MySQL ?
ans. We can use ENUM to limit the values that can go in the table . Example – A user create a table and gives a specific value of month , then other values of month would not enter in to table .
28. What are the triggers that can be used in MySQL ?
ans. Before insert , After insert , Before update , After update, Before delete and After delete
29. What is Heap table ?
ans. HEAP tables are present in memory and it is used for high speed storage for temporary basis .
30. What does myisamchk do ?
ans. It compress the MyISAM tables , which reduces their disk or memory . MyISAM is the default storage engine of MySQL .
You may also like to read following article :
- How to find files with SUID SGID and sticky bit permission
- How to Configure YUM
- 50 most popular linux commands
- How to use special file permission in linux
In this article we discuss about 30 basic MySQL interview question for database administrator. I hope this is useful for you.