Classic Jhumka Earrings Silver INR 113.00 Free Shipping Buy Now
Black Jhumka Earrings & Studs INR 94.00 Free Shipping Buy Now
Classic Jhumka Earrings Silver INR 207.00 Free Shipping Buy Now
Beautiful stud earing INR 93.00 Free Shipping Buy Now
Different Size Hoop and Stud Earrings Set INR 243.00 Free Shipping Buy Now
Golden Hoop Earing INR 70.00 Free Shipping Buy Now
Home Practice Tests MySQL Practice Tests MySQL Interview Questions for Freshers
25 Questions

 

MySQL Interview Questions for Freshers

  • Question 1 :
  • What is the difference between CHAR and VARCHAR

  • A list of differences between CHAR and VARCHAR:

    • CHAR and VARCHAR types are different in storage and retrieval.
    • CHAR column length is fixed to the length that is declared while creating table. The length value ranges from 1 and 255.
    • When CHAR values are stored then they are right padded using spaces to specific length. Trailing spaces are removed when CHAR values are retrieved.
  • Question 6 :
  • What are the disadvantages of MySQL

    1. MySQL is not so efficient for large scale databases.
    2. It does not support COMMIT and STORED PROCEDURES functions version less than 5.0.
    3. Transactions are not handled very efficiently.
  • Question 7 :
  • What is the difference between MySQL_connect and MySQL_pconnect?

  • Mysql_connect:

    1. It opens a new connection to the database.
    2. Every time you need to open and close database connection, depending on the request.
    3. Opens page every time when it loaded.

    Mysql_pconnect:

    1. In Mysql_pconnect, "p" stands for persistent connection so it opens the persistent connection.
    2. the database connection can not be closed.
    3. it is more useful if your site has more traffic because there is no need to open and close connection frequently and every time when page is loaded.
  • Question 10 :
  • How to display Nth highest salary from a table in a MySQL query?

  • Let us take a table named employee.

    To find Nth highest salary is:

     
    1. select distinct(salary) from employee order by salary desc limit n-1,1  

    if you want to find 3rd largest salary:

     
    1. select distinct(salary) from employee order by salary desc limit 2,1  
  • Question 14 :
  • What is the difference between primary key and unique key?

  • While both are used to enforce uniqueness of the column defined but primary key would create a clustered index whereas unique key would create non-clustered index on the column. Primary key does not allow ‘NULL’ but unique key allows it.
  • Question 15 :
  • How do you backup a database in MySQl?

  • MySQL Command - shell> mysqldump --databases test > dump.sql
    It is easy to backing up data with phpMyAdmin. Select the database you want to backup by clicking the database name in the left hand navigation bar. Then click the export button and make sure that all tables are highlighted that you want to backup. Then specify the option you want under export and save the output.
  • Question 16 :
  • What is the difference between BLOB and TEXT?

  • BLOBs are binary large object holding huge data. 4 types of BLOB are TINYBLOB, BLOB, MEDIBLOB, and LONGBLOB. TEXT is case-sensitive BLOB. 4 types of TEXT are TINY TEXT, TEXT, MEDIUMTEXT, and LONG TEXT.
  • Question 18 :
  • Is Mysql query is case sensitive?

  • SELECT VERSION(),CURRENT_DATE;
    SeLect version(),current_date;
    seleCt vErSiOn(),current_DATE;


    All these examples are same. It is not case sensitive.
  • Question 20 :
  • What are the advantages of MyISAM over InnoDB?

  • MyISAM follows a conservative approach to disk space management and stores each MyISAM table in a separate file, which can be further compresses, if required. On the other hand, InnoDB stores the tables in tablespace. Its further optimization is difficult.
  • Question 21 :
  • What is ISAM?

  • ISAM is abbreviated as Indexed Sequential Access Method.It was developed by IBM to store and retrieve data on secondary storage systems like tapes.
  • Question 22 :
  • What is the use of mysql_close()?

  • Mysql_close() cannot be used to close the persistent connection. Though it can be used to close connection opened by mysql_connect().
  • Question 23 :
  • What is InnoDB?

  • lnnoDB is a transaction safe storage engine developed by Innobase Oy which is a Oracle Corporation now.