how to create multi level unique id in mysql (composite unique key in mysql)

Multi level unique is very important feature in mysql. This feature is present all databases. Using this composite unique key we can achieve multilevel uniqueness.

Here I am going to give you how to create the composite unique key in mysql.

mysql> alter table `user` add unique `DATE_uuid` (`date`, `uuid`)

how to check indexes on table
mysql> show index from user;
+—————-+————+————+————–+————-+———–+————-+———-+——–+——+————+———+
| Table          | Non_unique | Key_name   | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+—————-+————+————+————–+————-+———–+————-+———-+——–+——+————+———+
| user |          0 | PRIMARY    |            1 | user_id         | A         |           0 |     NULL | NULL   |      | BTREE      |         |
| user |          0 | DATE_uuid |            1 | date        | A         |        NULL |     NULL | NULL   |      | BTREE      |         |
| user |          0 | DATE_uuid |            2 | uuid       | A         |           0 |     NULL | NULL   |      | BTREE      |         |
+—————-+————+————+————–+————-+———–+————-+———-+——–+——+————+———+
3 rows in set (0.01 sec)

mysql>

Incoming search terms:

You may like following Articles!

This entry was posted in MySql, tutorials and tagged , by Wordpress API. Bookmark the permalink.

About Wordpress API

API means Application Program interface. In Wordpress API we are giving all the information about wordpress API. We worked for many wordpress plugins and themes. We have expertise in PHP, Databases, Graphic Design, Ruby on Rails, Java, Wordpress, Drupal and many CMS. We always give you the best solutions about wordpress and other related topics in This Blog. We will give you always fresh tips and tricks and techniques about wordpress in this blog.

49 thoughts on “how to create multi level unique id in mysql (composite unique key in mysql)

  1. Pingback: Tweets that mention how to create multi level unique id in mysql (composite unique key in mysql) | Wordpressapi.com - Developer Code book -- Topsy.com

  2. Can I make subdirectories in my Web directory? No, because of limitations in the FreePort software you can’t create subdirectories in your public_html subdirectory. So all your Web files will have to go in that one directory. No, generally speaking. But if you can contribute something useful as a volunteer that requires shell access to do it, please ask.

  3. I admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!

  4. Amazing post! I initially found your blog a week or so ago, and I subscribed to your RSS feed the very same day. I have several cool ideas for some upcoming posts you could write. I’ll send you an email shortly. Keep up the great work.

  5. Intimately, the post is in reality the freshest topic on this registry related issue. I concur with your conclusions and will eagerly look forward to your forthcoming updates. Saying thanks will not just be enough, for the wonderful clarity in your writing. I will immediately grab your rss feed to stay abreast of any updates.

  6. I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful.

  7. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

  8. You really make it seem so easy with your presentation but I find this topic to be really something which I think I would never understand. It seems too complicated and very broad for me. I am looking forward for your next post, I will try to get the hang of it!

  9. Hi… I don’t know if you’ve been making changes, but your pages aren’t displaying correctly for me. The edges of the text are running into each other. I didn’t do this the other day. I don’t know if it’s something on my computer or if you’ve made a change… Just thought you might want to look at it. Thanks!

  10. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.

  11. This is my first visit to your blog. We are starting a new initiative in the same niche as this blog. Your blog provided us with important information to work on. You have done a admirable job.

  12. Hey – nice blog, just looking around some websites, seems a really nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run.

  13. When I recently discovered your web site and started following along, I had been thinking I’d post my very first comment. I don’t know just what to express except that I actually liked reading by means of. Great writings. I will retain on visiting this website much more usually.

  14. I stumbled upon your blog and it is actually fantastic for my situation. It includes awesome and useful posts. I read through a good number of of them and got a lot from them. In my opinion, you are doing an incredible work. Stick with it! I’d like to appreciate you for making such a lovely web site.

  15. Hey – nice blog, just looking around some blogs, seems a pretty nice platform you are using. I’m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?

  16. This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It?s the old what goes around comes around routine. Did you acquired lots of links and I see lots of trackbacks??

  17. I am not in reality sure if top methods include emerged almost things like that, other than I am definite that your huge job is clearly identified. I was wondering if you offer several registration to your RSS feeds since I would be very concerned.

  18. Nice post! You truly have a wonderful way of writing which I find captivating! I will definitely be bookmarking you and returning to your blog. In fact, your post reminded me about a strange thing that happened to me the other day. I’ll tell you about that later…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>