Monday, April 8, 2019

Mysql Interview Questions Part-1

Q- what is indexes in mysql ?
Answer:- 

Q- How many types of indexes in mysql ?

Q- What is the difference between clustered index and non clustered index?

Q- How to get nth highest salary in MySQL
SELECT salary FROM Employee  ORDER BY Salary DESC LIMIT n-1,1

1st highest salary in MySQL using LIMIT clause:
SELECT DISTINCT(salary) FROM Employee ORDER BY salary DESC LIMIT 0,1

2nd highest salary in MySQL using LIMIT clause:
SELECT DISTINCT(salary) FROM Employee ORDER BY salary DESC LIMIT 1,1

3rd highest salary in MySQL using LIMIT clause:
SELECT salary FROM Employee ORDER BY salary DESC LIMIT 2,1
                                             OR
SELECT DISTINCT(salary) FROM Employee ORDER BY salary DESC LIMIT 2,1

4th highest salary in MySQL using LIMIT clause:
SELECT salary FROM Employee ORDER BY salary DESC LIMIT 3,1
                                             OR

SELECT DISTINCT(salary) FROM Employee ORDER BY salary DESC LIMIT 3,1

Q- How to remove duplicate rows from table in mysql ?

Q- How to update gender male to female and female to meal in a table ?

Q- What are storage engine in mysql ?

Q- How many types of  storage engine in mysql ?

Q- How many types of storage engines in mysql ?

Q- How to create stored procedure, functions, view, trigger ?
Answer :- 
Stored Procedure in Mysql

Q- Stored procedure Vs Functions in mysql?

Q- How to debug stored procedure in?
Answer:- 
Use Visual Studio to debug Stored Procedure.
Choose a Stored Routine to Debug
Download : MySQL for Visual Studio (Archived Versions)
MySQL for Visual Studio
Debugging Stored Procedures and Functions



No comments:

Post a Comment