MySQL: Frequently asked Interview Questions and Answers Part 4

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.

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

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


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

Anvesh Patel

Leave a Reply

9 Comments on "MySQL: Frequently asked Interview Questions and Answers Part 4"

Notify of
avatar
Sort by:   newest | oldest | most voted
lasertest
Guest

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

Helen
Guest

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

janimilner
Guest

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.

cmillan
Guest

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

Stacy
Guest

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.

Lionel Testa
Guest

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?

lasertest
Guest

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

Reddy
Guest

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

wpDiscuz