Here is the List of Top Top 50 MYSQL Interviews questions and answers are there to prepare for the Interviews.
1.What is MySQL?
It is an database store collection of data. Datas are stored in the format of data.
2. Mention the some features of MySQL?
1. It is open source language.
2. It is a platform independent
3. It is user friendly with PHP
4. It uses Apache server, because Apache is open source.
3. Is it MySQL is designed by using C and C++?
Yes, MySQL is designed by using C and C++ in the programming world.
4. Who is or which one is developed the MySQL?
MySQL is developed by AB Corporation at 1995. Now is is owned by Oracle.
5. Mention some companies which is using the Mysql?
6. What is meant by SQL and mention it current versions?
SQL is the full form of Structure Query Language and it’s current version is 5.7
7. What are the types of database present in SQL?
There are two types of database are available.
DBMS ( Database management system)
RDBMS ( Relational Database management system)
8. What is DBMS?
In DBMS(DBMS) Data’s are stored in the form of file and there is no relation between table.
9. Mention the Features of RDBMS?
Data’s are stored in the form of table and there is relation between tables(it is the collecton of columns and rows).
10. What are the packages are available in MySQL?
Wamp(Windows Apache MySQL PHP)
Lamp(Linux Apache Mysql PHP)
Xamp(Extensible Apache mysql PHP)
Mamp(MAC Apache Mysql PHP)
11. What is the current version of the Wamp and mention it’s bytes?
Wamp current version is 3.0 and it is available in two types of version like 32 bit and 64 bit.
12. What are the types of commands are available in Mysql?
DDL(Data Definition Language)
DML(Data Manipulation Language)
DQL(Data Query Language)
TCL(Translation Control Language)
13. What is meant by Varchar in Mysql?
It is variable in length.it supports 0 to 65535 in length.It is also supports alphanumeric.The processing speed of the Varchar is low.
14. What is the features of the char?
It is supports for o to 255 and it is fixed in length.It occupies more memory.The processing speed of the char is very high compared to the Var char.
15. Whether timestamp is support for Null and mention the format of the Timestamp?
No. It is not support the the NULL and the syntax is Time(hh:mm:ss)
16. What is the maximum length of the database?
The maximum length of the Database is 64.
17. How to create a database in the MySQL?
Create database databasename;
Create database student;
Here student is the database name.
18. What is the use of the show tables command in Mysql?
It is used to show the table list in particular database.
19. What are actions we can able to perform in DDL?
20. Which command is used to view the structure of the table in MySQL?
21. What are the action are performed in the DML?
In DML we can able to insert, update, and delete the tables while we are creating the database.
22. Mention the syntax to create a Table in Mysql?
Create table tablename (colname datatype size)
Create table student(id int,name varchar(20));
In this size is mandatory only for the string types.
23. What are the action or process involved in DQL and TCL in the Mysql world?
In Mysql world for DQL
Select, use, show and desc.
In Mysql world for TCL
24. What is the use of the alter command?
Alter table tablename add colname datatypes();
Alter table student add name varchar(30);
25. If you want to change your table name in Mysql which command is used?
Rename table oldtablename to newtablename;
Rename table student to student 1;
Here student is the old table and student 1 is the new table.
26. In your table there are four columns are there like student id, name, address, phone no.In this if you want to delete the student id mention the syntax ?
Do delete an existing column te drop comment is used.
Syntax is :
Alter table student drop student id;
27. What is the use of the select command?
It is used to retrieve all columns in the table. The syntax is
Select * from tablename;
28. If you want add a particular columns in a table which command is used?
Insert command is used to insert the particular columns to the table.
29. What is the syntax of insert command?
Insert into tablename (colname 1,2,3…) values(1,2,3….). Insert is also used to pass a multiple values in the table.
30. What is the use of the truncate in MySQL?
Truncate is used to delete only table values but structure will be there.
31. What is meant by savepoint in Mysql?
Save point is used to store the temporary storage in the mysql.
Savepoint savepoint name;
If you are giving the savepoint=o; the value will be stored temporarily.
If you are giving the savepoint=1; the value will be stored permanent.
32. If you want to retrieve the table datas which command is used?
Rollback is used to retrieve the table values from the database.
33.What are the types of operators are involved in the Mysql?
In Mysql there are seven commands are used to develope or get the data.
34. Give the example to the IN and NOT IN command?
Select * from emp where salary IN (10000 to 200000)
Select * from emp where salary NOT IN (10000 to 200000)
35. Give the any example with the AND command in MySQL?
Select * from emp where salary = 15000 AND name= “Balaji”
36. In your table there is three names are starts with and ends with the “s”. If you want to select this name only which command is used?
For this like command is used.
If you want get the name start with “s”
Select * from tablename where colname like “s%”
2. If you want get the name end with “s”
Select * from tablename where colname like “%s”
37. What is the use of the distinct command in MySQL?
It is used to remove the duplicate content values in a table.
Select distinct(colname) from table;
38. What is the use of the order by command in the MySQL?
It is used to arrange the records in the ascending and descending order from the table.
39. If you have a table student, in this you want to fetch only 2 number of records which command is used?
The limit command is used to fetch the limited number of record.
Syntax: Select * from emp order by salary desc limit 2,2;
40. What is the use of the View in Mysql?
It is used to copy table values from one to another table.
Syntax: create view viewname as select colname from table;
41. What are the types of function in MySQL?
In MySQL there are three types of functions are there.
Date and time functions
42. In aggregate functions what are the options are available?
43. Mention some data and time functions?
44. Mentions the some string functions?
45. What is the use of the Trim command in MySQL?
Trim is used to remove the white space.
46. What is meant by subquery?
Query within a query is called the inner queries.In this sub queries Inner queries are executed first.
47. What is the use of the joins in MySQL?
It is used to join two or more values in the MySQL world.
48. What are the types of joins are available in MySQL?
There are two types of joins are available.
49. What are the two types of outer joins are available?
Left outer join
Right outer join
50. What is the use of the Inner join in MySQL?
It is used to retrieve common values from two tables. Inner join is one type of the sub queries.
Select colname from table 1 inner join table 2 on table 1. Colname =table 2.colname
51. What is meant by left outer join in Mysql?
It is used to retrieve all values from left table and common values from right table.
52. What is meant by procedures?
It is like a user defined functions, whenever we execute a same query again and again just create a procedure.
53. What is meant by Delimiter in MySQL?
Delimiter is used to change query execution point in MySQL.
Syntax: delimiter $$ or ||
54. What is meant by constraints in MySQL and mention it types?