,

How to add Primary Key and Auto Increment on different fields of MySql

 Normal code generated by MySql:-

CREATE TABLE `categorymaster` (
  `CategoryID` int(11) NOT NULL AUTO_INCREMENT,
  `Category` varchar(200) DEFAULT NULL,
  `IsActiv` int(11) DEFAULT NULL,
  `ImagePath` varchar(200) DEFAULT NULL,
  `DisplayOrder` int(11) DEFAULT NULL,
  PRIMARY KEY (`Category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

In the above data stucture I want to make the "Category" as Primary Key and "CategoryId" as Auto Increment.

But Table Wizard always give errors so, I decided to write my own Statement.

Following is the statement which will create perfect structure according to my requirement.

DROP TABLE `dbname`.`categorymaster`;
CREATE TABLE `categorymaster` (
  `CategoryId` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `Category` varchar(200) DEFAULT NULL,
  `IsActiv` int(11) DEFAULT NULL,
  `ImagePath` varchar(200) DEFAULT NULL,
  `DisplayOrder` int(11) DEFAULT NULL,
  UNIQUE KEY `CategoryId` (`CategoryId`),
   PRIMARY KEY (`Category`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Share:

57 comments:

Unknown said...

Thanks for sharing this. We're hoping to get some of this implemented by next quarter. This'll make things much easier. Thiago | http://www.cvd.net.au/cvd-solutions.html

.Net training in Lucknow said...

useful post... Thanks for sharing.

Unknown said...

Earn from Ur Website or Blog thr PayOffers.in!

Hello,

Nice to e-meet you. A very warm greetings from PayOffers Publisher Team.

I am Sanaya Publisher Development Manager @ PayOffers Publisher Team.

I would like to introduce you and invite you to our platform, PayOffers.in which is one of the fastest growing Indian Publisher Network.

If you're looking for an excellent way to convert your Website / Blog visitors into revenue-generating customers, join the PayOffers.in Publisher Network today!


Why to join in PayOffers.in Indian Publisher Network?

* Highest payout Indian Lead, Sale, CPA, CPS, CPI Offers.
* Only Publisher Network pays Weekly to Publishers.
* Weekly payments trough Direct Bank Deposit,Paypal.com & Checks.
* Referral payouts.
* Best chance to make extra money from your website.

Join PayOffers.in and earn extra money from your Website / Blog

http://www.payoffers.in/affiliate_regi.aspx

If you have any questions in your mind please let us know and you can connect us on the mentioned email ID info@payoffers.in

I’m looking forward to helping you generate record-breaking profits!

Thanks for your time, hope to hear from you soon,
The team at PayOffers.in

Unknown said...

Inbound Technical Support call | Call at: +91 981-142-0083 | inbound calls for tech support | tech support inbound calls A great online marketing company for tech support inbound calls, Inbound Technical Support call by osiel web

Unknown said...

Hey I was doing some research on "Complete IT Solutions" when I came across here at this Awesome post.

Unknown said...

It is an informative blog. I hope you would share more writing for helping us. economical It solutions are the need of everyone now a day that’s why the business of running a software house in developing.

james brownn said...

This is such a great resource that you providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.
SEO services pakistan

Web Development Company in India said...

Thank you so much for sharing. Well described. It helped a lot.

blogger said...

Thanks for sharing sql connection command. Yburis Infotech Pvt Ltd full IT solution provider company. For any help contact us.

Career Maker Infra said...

Nice blog..! I really loved reading through this article.Thanks for sharing.
Please do visit my website hope you'll like it:
Best real estate company in Lucknow
Best properties in Lucknow
Best plots in Lucknow
Fastest growing real estate company in Lucknow
Best Real estate company
Best development company in Lucknow

Adarsh Bagwani said...

Thanks for posting useful information.You have provided an nice article.
Please do visit my website hope you'll like it: Best nursery plants in Jaunpur
Best nursery services
Best Nursery plants
Best Bagwani services

Meal4U said...

I have read many of your post and this post is wonderful.... all of your post are just awesome
Please do visit my website hope you'll like it: Best tiffin service provider in Lucknow
Best Tiffin service in Lucknow
Best Tiffin Service
Best Homemade Food

Priya Singh said...

Thank you so much for sharing this article. if you want to get if you want to get any type of information about software or website then visit us.

Akhand Pratap Singh said...

Bigtown group is the best real estate comapny in lucknow
we provide luxirious homes and apartments in lucknow
for more info visit us: Bigtown Group

Ashish Singh said...

Nice Blog! Thanks for sharing.
Website Development Company in Lucknow 

SOftware Development in London said...

I personally recommend this blog, the links that the person has shared are fantastic.
IT Support in London
Software Development in London
Software Development in London
Money Transfer Software
Money Transfer System

Priya Singh said...

Thank you so much for this blog. Your post is very helpful for me. Inspired by you I have created a website Accounting and Billing software for small business.
Please visit my website

Pradeep Tiwari said...

Thank you so much for this blog. Your post is very helpful for me. If you want to get more information about software and website.
So Please visit my website

Ashish Singh said...

Thanks for sharing such a piece of information.

Software Development Company in Lucknow

theexpertize said...

Nice Blog with great tips
thanks for sharing.....
Data Analytics Training in Lucknow
HR Training in Lucknow
Business Training in Lucknow
Advance Excel training in Lucknow
Graphic designing in Lucknow
Personality Development Training In Lucknow
Digital Marketing Training Institute in Lucknow

Auctech IT Solution said...

Nice Blog with Excellent tips
thanks for sharing.....
3D Walkthrough Company
3D graphics company in lucknow
Website development and Digital Marketing In Lucknow
Motion Graphic Company in Lucknow
Brochure Design Company In Lucknow
3D Company in Lucknow
Graphic Design In Lucknow
3D Walkthrough Animation Services
3D Architechural Walkthrough Services

Advanced Excel Training in Lucknow said...

Thanks for sharing valuable content I appreciate your efforts, we are basedin Lucknow and our courses are as follows:
Data Analytics training in Lucknow
Data Analysis training in Lucknow
Advanced Excel training in Lucknow
Digital marketing training in Lucknow
Human Resource training in Lucknow
Graphic Designing training in Lucknow
Advanced Excel training in Lucknow

TEENPATTIDAIMOND said...

Nice Blog With Full of Knowledge
Thanks For Sharing.....
Best Teen Patti Game In India
Teen Patti Game in India
Online Teen Patti App In India
3 Patti Game App in India
Best 3 Patti In India
3 Patti Online In India
Teen Patti Gaming App Development Company In India
3 patti Jobs in India
Teen Patti Career in India
Teen Patti Gaming Software In India
Teen Patti Game Development Plateform services
Teen patti Mobile App Development
Teen patti For Mobile Development

Casinopokerguru said...

Wonderful Post,

Thanks a lot for sharing the great piece of the information with us. I would surely refer to the steps to find an ideal casino software providers.
We are online casino games development company Casino Poker Guru. we develop the best online live casino poker sites and can hire our casino game developers.

Keep it works and share with us your latest post.

Thanks again!

URBAN AXIS said...

Nice Blog with Great Tips
Thanks for sharing.....
RERA Registered Projects
RERA Registered Projects In Lucknow
Real Estate Developers In Lucknow
Real Estate Builder In Lucknow
Best Real Estate Project In Lucknow
Best property in lucknow
Best Residential Flats In Lucknow
Affordable Flats In Lucknow

VINAY SINGH said...

Useful information Thank-you for sharing. really helpful keep sharing your views. Please visit link mentioned below and share your views on them.
hvac training in lucknow
autocad training in lucknow
php training in lucknow
python training in lucknow
account and finance training institute in lucknow
digital marketing training in lucknow

standwithdignity said...

Nice Blog With Full of Knowledge
Thanks For Sharing.....
Imam Hussain
Imam Hussain In USA
Ashura In USA
Ashura
Arbaeen
Arbaeen In USA
Best Teen Patti Game In India
Tragedy In karbala
Tragedy In karbala In USA
Stand With Dignity
Karbala In USA
Karbala
Who is hussain Standwithdignity

SIPL training said...

SIPL

Thank you so much for sharing this information.

SAP training in lucknow
HVAC training in lucknow
Digital Marketing training in lucknow
SEO training in lucknow
Python training in lucknow
REVIT MEP training in lucknow

aspetto said...

Hi,

Thanks a lot for sharing this valuable and useful content with us. Being a reputational company in bulletproof suits providers in 2019. We have been on an epic ride and paved our way to becoming the Best in designing the suits in US. Aspetto known as an essential part of our voyage and we will continue to serve them better with the same loyalty and ace-quality of products. Aspetto is proud to be America's First Bullet Resistant Clothing Line. Shop for men's suits, body armor, and ballistic clothing.

We always understand your needs and provide you exactly what you want.

Thanks again for sharing valuable content with us.

Thanks & Regards!
Aspetto SEO Team

Anonymous said...

Great article, It's one of the best content in your site. I really impressed the post. Good work keep it up. Thanks for sharing the wonderful post.See also Best International School.
Best CBSE School in Ballia

MLM Softonline said...

Awesome Blog Post Informative Content
Regards
Software Company in Kanpur

Anonymous said...

Great article, It's one of the best content in your site. I really impressed the post. Good work keep it up. Thanks for sharing the wonderful post.
Best Chicken kurti

SAP Training in Lucknow said...

Its really great being a content writer I can understand how tough is it to write and develop the content ,Thanks for sharing this wonderful informationSAP Training in Lucknow 
Digital marketing training in Lucknow 
AUTOCAD Training in Lucknow  
PHP Training in Lucknow  
SAP FICO Training in Lucknow  

belly sons said...

i-LEND is an online marketplace connecting borrowers and lenders for loans. Although i-LEND verifies credentials of registered users on the site, it does not guarantee any loan offers by lenders nor does it guarantee any repayments by borrowers. Users make offers/loan requests at their own discretion with the understanding of the risks involved in such transactions including loss of entire capital and/or no guarantee of recovery. Please read our Legal agreements to understand more. borrow money

Amit said...

Second Innings Home is the first and only premium home & health care service in India. Second Innings Home proposed across the nation features a beautiful campus ideally located in a well-maintained gated community in the format of a Star Hotel with luxurious amenities. It’s convenient to enjoy the privacy and to be near the city and nearby facilities. And yet it retains a sense of community spirit and the warmth of a small community. good retirement homes in Hyderabad

maxwell said...

Are you wishing to purchase the best work socks for sweaty feet ? Well, everyone desires to buy because bb guns are the best for Airgun sports. People use these guns for target practice and training.

Netzent Technologies said...

Hey Nice Blog!!! Thank you for sharing information. Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
Web Designing Services
Web Development Services
Software Development Services
Mobile Applications Services
Bulk SMS Services
Domain and Hosting Services
Maintenance & Support Services
Software Testing Services
IT Consulting Services

Rohit said...

Great Article & Thanks for sharing.

Oflox Is The Best Digital Marketing Company In Dehradun Or Digital Marketing Institute In Dehradun

maxwell said...

Everyone wishes to pass on a Largest Android Tablets? with them. Nevertheless, the greatest screen tablets are not conveniently found. Tablets are the hugest electronic device that people like to pass on.

Paul hallen said...

Get extremely comfortable rides from and to Charles M. Schulz–Sonoma County Airport Limo Transfer and enjoy your journey.

Paul hallen said...

if you are looking for a reliable limo service for your airport trips, look no more and book London Heathrow Airport Limo Transfer now!

Kashi Digital Agency said...

Nice to be visiting your blog again, it has been months for me.

Leading Website Design Company India - Free Domain - Free Hosting | We Are Providing Low Cost Affordable Web Designing For Startups, Small & Medium Business Who Wants To Have Their Online Presence.Website Design Company India - Free Domain - Free Hosting

Reliance Beauty & Health said...

Hey Nice Blog!!! Thank you for sharing information. Wonderful blog & good post.Its really helpful for me, waiting for a more new post. Keep Blogging!
Manufacturer & Suppliers of Healthcare Products, Beat covid-19 Products, Hand Sanitizer, Hand Sanitizer Dispenser, Air Purifier, Disposable Face Mask, N95 mask, FFP2 respiratory, Surgical Mask, Collagen Mask,Peal-off Mud Mask,Beauty Equipment, OEM, ODM, Private Label. Manufacturer & Suppliers of Covid-19 Products

Sam said...

you have definitely done some serious research! i like it when someone do theirwork with such devotion digital marketing agency

Amit said...

Stones International Dubai offers professional and tailored Top Real Estate Company in Dubai to our wide base of clients. With a diverse team of highly-qualified and experienced client managers on board, we are ready to assist our customers, whether you are a first-time property finder looking to Rent an apartment in Dubai, or an owner planning to sell a property in your possession.
With an ever-competitive Villa for sale in Dubai, we can provide you hassle-free property solutions, optimizing the best deals for owners and helping buyers acquire their dream property at the most competitive price.
We have an extensive selection of properties such as villas, apartments, townhouse, office and retail spaces, plots and land, full buildings and Real Estate in Dubai our catalogue, located across a wide range of areas

Tech Crunch App said...

Tech Crunch App - We provide news from all over world. Our site keeps you updated on Government news update, Politics, US News, Travel and more.

Sam said...

Great Article & Thanks for sharing. samdigitech

Veronica Kate said...

Hi, I am Veronica Kate. I am working as a full-time academic consultant with Livewebtutors. We are providing paper editing service and Deakin Referencing Generator to university and college students across the globe. I have been successfully helping students, scholars and professionals in various services like I mentioned above for more than 5 syears and hold excellent writing, proofreading and editing skills. You would also find various academic tools on Livewebtutors like Paraphrasing Tool and Harvard Referencing Generator.

source codes said...

Thank you for sharing this informative content. It's really very helpful.

Best Software Development Company in Nashik
Digital marketing company in nashik
Digital marketing training in nashik
Academic Projects provider in nashik
ERP software provider in nashik
Billing software provider in nashik

Best nursing college in allahabad said...

I find this blog to be very interesting and very resourceful. I would say that your blogs are really interesting and informative for me and this article explained everything in detail.
GNM college in Allahabad
best homeopathic college in allahabad
best nursing college in allahabad
Best anm college in allahabad
best gnm college in allahabad

Best nursing college in allahabad said...

reat Article. Thank-you for such useful information. I have read many of your post and this post is wonderful....
Best college of pharmacy in allahabad
Institute for pharmacy in allahabad
Best college for D.Pharma in allahabad
D.Pharma college in allahabad
College of pharmacy in allahabad
Get trained by professional and build your career.

Best nursing college in allahabad said...

Useful information Thank-you for sharing. It is really helpful, keep sharing your views. Please visit link mentioned below and share your views on them.
Best homeopathy college in prayagraj
best homeopathy institute in Allahabad
top college of pharmacy in kaushambi, allahabad
homeopathic college of pharmacy in Kaushambi

William Smith said...

Extremely well written paper, however a few more points can be added to make it all the more resourceful. Visit livewebtutors and make most of the valuable assignment help services as offered by the best in the business. Feel free to get in touch at any point of the day.

awa said...

I was more than happy to uncover this great site. I need to to thank you for your time due to this fantastic read!! I definitely enjoyed every bit of it and I have you bookmarked to see new information on your blog.
Best Website Company IN Lahore

Software development company in Lucknow said...

Thank you for informing SQL Solution. Contact us for website designing information.

Radhya said...

Big Aquatic is a software company that provides the best software compared to another provider. Visit my profile.

Krishna Kushwaha said...

Hi !
You’ve outdone yourself this time.
This is probably the best, most concise step by step guide I’ve ever seen on how to build a successful blog.
Thank you so much.