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

MySQL Questions & Answers (Compiled from UPSC, SSC ,PSC ,IBPS previous question papers)

  • What is save point in MySQL?

  • AA defined point in any transaction is known as savepoint. SAVEPOINT is a statement in MySQL which is used to set a named transaction save point with a name of identifier.
  • What is the difference between primary key and unique key?

  • AWhile 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.
  • How to display Nth highest salary from a table in a MySQL query?

  • A

    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  
  • How to use the MySQL slow query log?

  • AInformation that is provided on the slow query log could be huge in size. The query could also be listed over thousand times. In order to summarize the slow query log in an informative manner one can use the third party tool “pt-qury-digest”.
  • What is the difference between MySQL_connect and MySQL_pconnect?

  • A

    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.