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?
Explain any three date function of MySQL.
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.
mysql> SELECT DATEDIFF('2007-12-31 23:59:59','2007-12-30');
mysql> SELECT DATEDIFF('2010-11-30 23:59:59','2010-12-31');
ADDDATE(date,INTERVAL expr unit), ADDDATE(expr,days)
mysql> SELECT ADDDATE('2008-01-02', INTERVAL 31 DAY);
mysql> SELECT ADDDATE('2008-01-02', 31);
EXTRACT(unit FROM date)
It extracts parts from the date rather than performing date arithmetic.
mysql> SELECT EXTRACT(YEAR FROM '2009-07-02');
mysql> SELECT EXTRACT(YEAR_MONTH FROM '2009-07-02 01:02:03');
Explain any three string function of MySQL.
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
Please share your ideas and opinions about this topic with me, your contribution will add true value to this topic.
If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.
If you like this post, then please share it with others.
Please follow dbrnd.com, I will share my experience towards the success of Database Research and Development Activity.
I put up a post every day, please keep reading and learning.
Discover Yourself, Happy Blogging !
Anvesh M. Patel.