Covid-19 Update!!    We have enabled all courses through virtual classroom facility using Skype or Zoom.    Don't stop learning.    Enjoy Learning from Home.

30% Discount Python        30% Discount Webdesign        30% Discount SEO        30% Discount Angular8        Free SQL Class        Free Agile Workshop       Free HTML Sessions        Free Python Basics

Important MySQL Interview Questions and Answers

 MySQL Interview Questions

1. What is MySQL?

MySQL is an open source DBMS which is built, supported and distributed by MySQL AB (now acquired by Oracle)

2. What are the technical features of MySQL?

MySQL database software is a client or server system which includes
  • Multithreaded SQL server supporting various client programs and libraries
  • Different backend
  • Wide range of application programming interfaces and
  • Administrative tools.

    3. Why MySQL is used?

    MySQL database server is reliable, fast and very easy to use. This software can be downloaded as freeware and can be downloaded from the internet.

    4. What are Heap tables?

    HEAP tables are present in memory and they are used for high speed storage on temporary basis.
  • BLOB or TEXT fields are not allowed.
  • Only comparison operators can be used =, <,>, = >,=<.
  • AUTO_INCREMENT is not supported by HEAP tables.
  • Indexes should be NOT NULL.

    5. What are the advantages of MySQL when compared with Oracle?

    MySQL is open source software which is present at any time and has no cost.
  • MySQL is portable
  • GUI with command prompt.
  • Administration is helped using MySQL Query Browser.

    6. Differentiate between FLOAT and DOUBLE?

    The differences between FLOAT and DOUBLE are:
  • FLOAT is the place where Floating point numbers are stored with 8 place accuracy and it has 4 bytes.
  • DOUBLE is the place where Floating point numbers are stored with accuracy of 18 places and it has 8 bytes.

    7. Differentiate CHAR_LENGTH and LENGTH?

    The difference between CHAR_LENGTH and LENGTH are
    The numbers are similar for Latin characters but they vary for Unicode and encodings. CHAR-LENGTH is character count and the LENGTH is byte count.

    8. Define REGEXP?

    REGEXP is a pattern match in which matches pattern anywhere in the search value.

    9. Difference between CHAR and VARCHAR?

    The differences between CHAR and VARCHAR are:
    CHAR and VARCHAR vary in storage and retrieval CHAR column length is fixed to the length that is mentioned while creating table. The length value ranges from 1 and 255 When CHAR values are saved then they are right padded using spaces to particular length. Trailing spaces are removed when CHAR values are recovered.

    10. Give string types available for column?

    The string types are:
  • SET
  • BLOB
  • ENUM
  • CHAR
  • TEXT
  • VARCHAR

    11. What storage engines are used in MySQL?

    Storage engines are called table types and the data is stored in files using different techniques.
    Technique involves:
  • Storage mechanism
  • Locking levels
  • Indexing
  • Capabilities and functions.
  • 12. What are the drivers in MySQL?

    Following are the drivers available in MySQL:
  • PHP Driver.
  • JDBC Driver.
  • ODBC Driver.
  • C WRAPPER.
  • PYTHON Driver.
  • PERL Driver.
  • RUBY Driver.
  • CAP11PHP Driver.
  • Ado.net5.mxj.

    13. What does a TIMESTAMP do on UPDATE CURRENT_TIMESTAMP data type?

    TIMESTAMP column is updated with Zero when the table is created. UPDATE CURRENT_TIMESTAMP modifier updates the timestamp field to current time whenever there is a change in other fields of the table.

    14. What is the difference between primary key and candidate key?

    Every row of a table is identified uniquely by primary key. There is only one primary key for a table.
    Primary Key is also a candidate key. By common convention, candidate key can be designated as primary and which can be used for any foreign key references.

    15. What are federated tables?

    Federated tables which permits access to the tables located on other databases on other servers.

    16. How can you see all indexes defined for a table?

    Indexes are defined for the table by:SHOW INDEX FROM < tablename >;

    17. What is the difference between BLOB AND TEXT?

    A BLOB is a binary large object that can hold a variable amount of data.
    There are four types of BLOB
  • TINYBLOB
  • BLOB
  • MEDIUMBLOB and
  • LONGBLOB They all differ only in the maximum length of the values they can hold. A TEXT is a case-insensitive BLOB.
    The four TEXT types
  • TINYTEXT
  • TEXT
  • MEDIUMTEXT
  • LONGTEXT They all match to the four BLOB types and have the same maximum lengths and storage needs. The only difference between BLOB and TEXT types is that sorting and differentiation is performed in case-sensitive for BLOB values and case-insensitive for TEXT values.

    18.What is the difference between mysql_fetch_array and mysql_fetch_object?

    mysql_fetch_array -Returns a result row as a related array or a regular array from database.
    mysql_fetch_object – Returns a result row as object from database.

    19. Where MyISAM table will be stored and also give their formats of storage?

    MyISAM table is stored on disk. It has three formats,
    They are as follows:
  • The ‘.frm’ file saves the table definition.
  • The data file has a ‘.MYD’ (MYData) extension.
  • The index file has a ‘.MYI’ (MYIndex) extension.

    20. What is ISAM?

    ISAM stands for Indexed Sequential Access Method. It was developed by IBM to store and recover data on secondary storage systems like tapes.