Database Research & Development

  • Home
  • NoSQL
    • NoSQL
    • Cassandra
  • Databases
    • Database Theory
    • Database Designing
    • SQL Server Coding Standards
    • SQL Server
    • PostgreSQL
    • MySQL
    • Greenplum
    • Linux
  • Interviews
    • SQL Server Interviews
    • MySQL Interviews
    • SQL Puzzles
  • DBA Scripts
    • SQL Server DBA Scripts
    • PostgreSQL DBA Scripts
    • MySQL DBA Scripts
    • Greenplum DBA Scripts
  • Home
  • Blog Archives !
  • (: Laugh@dbrnd :)
  • Contact Me !
sqlserverinterviews
Home 2015 October MySQL: Frequently asked Interview Questions and Answers Part 4

MySQL: Frequently asked Interview Questions and Answers Part 4

This article is half-done without your Comment! *** Please share your thoughts via Comment ***

What happens when you reach maximum value for AUTO_INCREMENT field?

It stops the incrementing  and generate an error like, the key is already in use.


Using which command, you can get the last inserted id by AUTO_INCREMENT?

LAST_INSERT_ID will return the last value assigned by Auto_increment.


Command to check indexes for a table.

SHOW INDEX FROM <table_name>;


Is Mysql query is case sensitive?

No:


Explain any three date function of MySQL.

DATEDIFF(expr1,expr2):
DATEDIFF() returns expr1 − expr2 expressed as a value in days from one date to the other. expr1 and expr2 are date or date-and-time expressions. Only the date parts of the values are used in the calculation.

1
2
3
4
mysql> SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30');
-> 1
mysql> SELECT DATEDIFF('2010-11-30 23:59:59','2010-12-31');
-> -31

ADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)

1
2
3
4
5
mysql> SELECT ADDDATE('2008-01-02', INTERVAL 31 DAY);
-> '2008-02-02'
 
mysql> SELECT ADDDATE('2008-01-02', 31);
-> '2008-02-02'

EXTRACT(unit FROM date)
It extracts parts from the date rather than performing date arithmetic.

1
2
3
4
mysql> SELECT EXTRACT(YEAR FROM '2009-07-02');
-> 2009
mysql> SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');
-> 200907


Explain any three string function of MySQL.

Please visit this article:


How you can perform pagination in MySQL Query?

Using LIMIT and OFFSET.
You can skip some number of rows by OFFSET and set the LIMIT for the next number of rows.


What is the difference between NOW() and CURRENT_DATE()?

NOW() format : YYYY-MM-DD HH:MM:SS
CURRENT_DATE() format: YYYY-MM-DD

Oct 3, 2015Anvesh Patel
MySQL: Frequently asked Interview Questions and Answers Part 3MySQL: Frequently asked Interview Questions and Answers Part 5
Comments: 9
  1. lasertest
    October 8, 2015 at 9:23 am

    Good article. I will be dealing with some of these issues as well..

  2. Helen
    October 15, 2015 at 7:39 pm

    This is a topic that is close to my heart… Best wishes! Where are your contact
    details though?

    • Anvesh Patel
      Anvesh Patel
      October 15, 2015 at 7:43 pm

      Thanks !
      You can contact me at anvesh@dbrnd.com

  3. janimilner
    October 16, 2015 at 3:27 am

    Heya i’m for the first time here. I came across this board and I find It really useful
    & it helped me out much. I hope to give something
    back and help others like you helped me.

  4. cmillan
    October 16, 2015 at 9:30 am

    As the admin of this web page is working, no doubt
    very soon it will be well-known, due to its feature contents.

  5. Stacy
    November 1, 2015 at 9:03 pm

    Hey There. I found your weblog using msn. This is an extremely well written article.
    I will be sure to bookmark it and return to learn more
    of your useful info. Thanks for the post. I will certainly
    comeback.

  6. Lionel Testa
    November 15, 2015 at 5:25 pm

    wonderful issues altogether, you just received a new reader. What would you suggest about your submit that you simply made a few days in the past? Any sure?

  7. lasertest
    November 21, 2015 at 5:58 am

    I have read so many articles or reviews about the blogger lovers
    but this post is really a fastidious post, keep it up.

  8. Reddy
    March 11, 2016 at 9:24 am

    Hey Anvesh,

    I have read so many articals and bogs but this is really wonderfulll…

    Thanks you so much , keep writing , Good to have more details about innodb architecture in detail and mysql cluster setup information.

    Thanks
    Reddy

Anvesh Patel
Anvesh Patel

Database Engineer

October 3, 2015 MySQL, MySQL InterviewAnvesh Patel, database, database research and development, dbrnd, interview, MySQL, MySQL Command, MySQL Database Administrator, MySQL Database Designing, MySQL Database Programming, MySQL Error, MySQL Performance Tunning, MySQL Query, MySQL Tips and Tricks
About Me!

I'm Anvesh Patel, a Database Engineer certified by Oracle and IBM. I'm working as a Database Architect, Database Optimizer, Database Administrator, Database Developer. Providing the best articles and solutions for different problems in the best manner through my blogs is my passion. I have more than six years of experience with various RDBMS products like MSSQL Server, PostgreSQL, MySQL, Greenplum and currently learning and doing research on BIGData and NoSQL technology. -- Hyderabad, India.

About DBRND !

dbrnd

This is a personal blog (www.dbrnd.com).

Any views or opinions represented in this blog are personal and belong solely to the blog owner and do not represent those of people, institutions or organizations that the owner may or may not be associated with in professional or personal capacity, unless explicitly stated.

Feel free to challenge me, disagree with me, or tell me I’m completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or anonymous comments) - so keep it polite.

The content of this website is protected by copyright. No portion of this website may be copied or replicated in any form without the written consent of the website owner.

Recent Comments !
  • Anvesh Patel { Sure will do... } – May 27, 12:43 PM
  • Anvesh Patel { Great... } – May 27, 12:41 PM
  • Anvesh Patel { Great... } – May 27, 12:39 PM
  • Anvesh Patel { Great... } – May 27, 12:36 PM
  • Anvesh Patel { Great... } – May 27, 12:28 PM
  • Anvesh Patel { Great... } – May 27, 12:27 PM
  • Anvesh Patel { Great... } – May 27, 12:16 PM
  • Older »
Follow Me !
  • facebook
  • linkedin
  • twitter
  • youtube
  • google
  • flickr
© 2015 – 2019 All rights reserved. Database Research & Development (dbrnd.com)
Posting....