Creating a field with a Key of MUL

Posted on 2004-11-23
Last Modified: 2008-02-01
 When you use the Desc table command, there is a column termed 'KEY" in which each field can be nothing, PRI, or MUL.  When I create a table what is the syntax to make a field have a Key of MUL ?
Question by:parkhill04
    LVL 18

    Expert Comment

    Referencing   (page is dead, google cache is available):

    "MUL means that the key allows multiple rows to have the same value.  That is, it's not a UNIque key. "

    Accepted Solution

    you can create "MUL" key this way:
    create table example (
     nonunique int(9),

    usual use is when you have 1:N or N:N relation between tables, for example:
    create table colors (
     id_color int(5) unsigned not null auto_increment,
     name varchar(50),
     primary key(id_color)

    create table cars (
     id_car int(9) unsigned not nul auto_increment,
     carname varchar(100),
     id_color int(5) unsigned not null,
     primary key(id_car),

    relation between colors and cars is 1:N - so id_color is multiple key in cars table

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Fore-Foreword Today (2016) Maxmind has a new approach to the distribution of its data sets.  This article may be obsolete.  Instead of using the examples here, have a look at the MaxMind API ( …
    Introduction In this installment of my SQL tidbits, I will be looking at parsing Extensible Markup Language (XML) directly passed as string parameters to MySQL 5.1.5 or higher. These would be instances where LOAD_FILE (…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now