how we can use more then one primary key in Single Table

Answer Posted / mukesh

Its impossible to create two primary key in a single table
but if we use composite key we have do it just like that

CREATE TABLE Test (id1 INT NOT NULL, id2 INT NOT NULL, name
CHAR(20) NOT NULL, PRIMARY KEY(id1,id2));

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between sql and mysql and oracle?

430


How to drop an existing view in mysql?

522


Where the database is stored in mysql?

484


What is row level locking?

489


Can we rollback truncate in mysql?

512






Is mysql server free?

481


How do I start mysql server?

461


Can foreign key have duplicate values?

496


How to escape special characters in sql statements?

521


How to delete a column and add a new column to database

496


What are the advantages of myisam over innodb?

556


How can you find out the version of the installed mysql?

683


How to check if value already exists in mysql database in php?

436


Where’s database data actually stored? Is there a way to see the files which are stored?

497


Is mysql a free database?

478