MySQL Interview Questions And Answers

1. What is MySql?

Ans: MySQL is one of the excellent Relational Database Management System(RDBMS) which is utilised to build numerous Web-Based applications or software.

2. Explain about Database?

Ans: The database is one individual application in which we can store the data. Each and every database contains one or more APIs for accessing, managing, creating, replicating and also searching the data.

3. List the RDBMS terminologies?

Ans:

  • Database 
  • Table 
  • Column
  • Row 
  • Redundancy 
  • Primary Key
  • Foreign Key
  • Compound Key
  • Index 
  • Referential Integrity  

4. Explain why MySql is very popular?

Ans: MySql is one of the fast and easy to use RDBMS that is being used by many small and big businesses there are quite a few reasons for MySql being popular they are 

  • There is no need to pay anything to use MySQL as it is issued beneath an open-source license 
  • The standard that is used in MySql is the very well-known SQL data language
  •  MySql works well even with the massive data sets
  • MySql is very fast at working

5. Explain the working of MySql on MySql server?

Ans: There are three basic steps to describe the working of MySql on the MySql server

  1. MySql build a database that lets us create tables that store the data and manipulate it and also describe the relationship among the different tables
  2. Utilising few particular SQL expressions on MySql users can make requests through the command prompt or GUI screen
  3. And Finally, the server will produce the results by responding with the requested expressions upon the client-side

6. What are the characteristics of MySql?

Ans: 

  • MySql is very easy to use 
  • When it comes to security MySql is the best 
  • This is a standard client/server architecture
  • We can download MySql for free
  • It is feasible
  • It is scalable

7. List the data types of MySql?

Ans:

  • Numeric Data Type

  • Date and Time Data Type

  • String Data Types

  • Large Object Data Types

8. What are the types of variables in MySql?

Ans: There are three basic types of variables in MySql they are

  • User-Defined variables

  • Local variables

  • System variables

9. Explain about user-defined variables?

Ans: User-defined variables are not case sensitive and they are not visible to any other person except the one who declared them, the maximum length of the user-defined variables can be of 64-characters

10. Write syntax for the SET statement?

Ans: SET @variable_name= value;

11. How can we display variables from the table?

Ans: We can display the variables by using Select statement

12. Write Syntax for creating a table?

Ans: CREATE TABLE nameofthe_table(coloumn_name, coloumn_type….);

13. What is a View?

Ans: Views are designed for providing security by encapsulating the tables name. Data will be present in the virtual table and it is not stored permanently. Views always display the selected data

14. Do you know the default port number of MySQL server?

Ans: 3306 is the default port of MySQL server

15. Which command is used to insert data into a MySQL table?

Ans: INSERT INTO is the command that is used to insert the data into the table

16. What are the operators that can be used in where clause?

Ans: 

  • =(equal to)
  • !=(not equal to)
  • >(greater than)
  • <(less than)
  • >=(greater than or equal to)
  • <=(less than or equal to) 

17. What is ISNULL()?

Ans: This function is used to check whether there is a NULL value or not, if there is a NULL value then this function returns true

18. List the DDL commands?

Ans:

  • Create
  • Drop
  • Alter
  • Truncate
  • Rename 

19. What are DML commands?

Ans:

  • Select
  • Insert
  • Update
  • Delete 

20. Why do we use the TRUNCATE command?

Ans: We can remove the records from the table by using this truncate command

21. Why do we use ALTER command?

Ans: We can alter the current database by using ALTER command

22. What is the use of GRANT command?

Ans: GRANT command will allow the users to obtain the database

23. List different string types?

Ans:

  • SET
  • ENUM
  • TEXT
  • VARCHAR
  • CHAR
  • BLOB  

24. What do you know about triggers?

Ans: A trigger means a collection of codes which executes in acknowledgement to few events.

25. Which language is used to develop MYSQL?

Ans: C and C++ are the languages that are used to develop MYSQL

26. Why do we use SELECT CURRENT_DATE()?

Ans: This method is used to know the current date 

27. How to access the tables that are in another database?

Ans: Federated tables allot access over the tables that are present on different databases on the different servers. 

28. Explain about ISAM?

Ans: It is a method to file management generated by IBM which gives records to obtain randomly or even sequentially.

29. List the drivers in MySQL?

Ans:

  • PHP Driver
  • ODBC Driver
  • JDBC Driver
  • RUBY Driver
  • PERL Driver

30. How many types of TEXT are there and what are they?

Ans: There are four types of TEXT they are

 

  • TINY TEXT
  • TEXT
  • MEDIUM TEXT 
  • LONG TEXT