The structure of table view buyers is as follows:
+----------------+-------------+------+-----+---------+-----
-----------+
| Field | Type | Null | Key | Default | Extra |
+----------------+-------------+------+-----+---------+-----
-----------+
| user_pri_id | int(15) | | PRI | NULL | auto_increment |
| userid | varchar(10) | YES | | NULL | |
+----------------+-------------+------+-----+---------+-----
-----------+
the value of user_pri_id the last row 2345 then What will
happen in the following conditions?

Condition1: Delete all the rows and insert another row
then. What is the starting value for this auto incremented
field user_pri_id ,
Condition2: Delete the last row(having the field value
2345) and insert another row then. What is the value for
this auto incremented field user_pri_id

Answers were Sorted based on User's Feedback



The structure of table view buyers is as follows: +----------------+-------------+------+-----+---..

Answer / guest

2346

Is This Answer Correct ?    4 Yes 0 No

The structure of table view buyers is as follows: +----------------+-------------+------+-----+---..

Answer / amita

in first condition even though u deleted all the records
from the table it takes the next no. of last deleted record.
suppose there is 2000 records in the table then it will take
2001.
and in second condition the ans is 2346

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More MySQL Interview Questions

How many tables will create when we create table, what are they?

5 Answers  


The table tbl_sites contains the following data: ----------------------------------------------------- Userid sitename country ------------------------------------------------------ 1 sureshbabu indian 2 PHPprogrammer andhra 3 PHP.net usa 4 PHPtalk.com germany 5 MySQL.com usa 6 sureshbabu canada 7 PHPbuddy.com pakistan 8. PHPtalk.com austria 9. PHPfreaks.com sourthafrica 10. PHPsupport.net russia 11. sureshbabu australia 12. sureshbabu nepal 13. PHPtalk.com italy Write a select query that will displayed the duplicated site name and how many times it is duplicated?

4 Answers   Afixi, GE,


What is the difference between CHAR and VARCHAR data types?

2 Answers   Ramco,


What is dirty read and phantom read?

0 Answers  


What are date and time data types in mysql?

0 Answers  






How are mysql timestamps seen to a user?

0 Answers  


How to write date and time literals?

0 Answers  


What are the differences between char and varchar?

0 Answers  


Explain % and _ inside like statement?

0 Answers  


How do I install and use mysql?

0 Answers  


What is foreign key in mysql?

0 Answers  


How to get nth highest salary from table in a mysql?

0 Answers  


Categories