I often used an auto increment primary key in creating my table due to unavailable candidate for a primary key. With the use of the use of the auto increment property, you will avoid duplicate entries for your primary key.
So here is the easy way on how to do it.
First, you add new table and you write the table name, column name, data type, length. For your primary key, you must set the data type into integer since you cannot increment other data types.
Then, under the index column, select PRIMARY from the drop down menu.
Third, you need to check the checkbox under the A_I column. A_I stands for auto increment.
Click the save button and that's it! You're done! Hope this helps!
Home /
Auto Increment /
MySQL /
AUTO INCREMENT IN SQL: How to Set Your Primary Key To Auto Increment
Friday, January 29, 2016
AUTO INCREMENT IN SQL: How to Set Your Primary Key To Auto Increment
Related Articles :
SQL SERVER MAX: Display the Maximum Number in ColumnSQL Max is used to find the maximum value in a certain column in a table. In my example, I have the SALES table below with record ...
SQL SELECT DISTINCT AND GROUP BY: Select Distinct Values in SQL and Group BySelect is used to display all columns from a table. This includes records with redundancies. So if you want to display records wi ...
AVERAGE IN SQL: Display The Average of A Column From DatabaseAnother arithmetic function in SQL is the AVERAGE function used to solve for the average of a specified column in your table.I have tw ...
SQL SELECT GROUP BY: Display Sum of a Certain Column With Select Group ByOn my previous post, we used the SUM function to calculate the TotalSales in a store. What if we want to display the TotalSales by PRO ...
PHP INSERT INTO: Add New Record Into A DatabaseData is essential in an organization. So storing it in a database helps an organization to easily store it so they can retrieve it in ...
Subscribe to:
Post Comments (Atom)
Casino Slot Machines Near You - MapyRO
ReplyDeleteCasino Slot Machines Near Me - Find Casino Slot Machines Near 강원도 출장샵 You and Search for Casinos Near You 파주 출장안마 in the 군포 출장샵 This map shows the closest casinos to 동해 출장마사지 your city, in real time, 경주 출장안마