Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up

What is the difference between a primary key and a unique key?

  1. A A primary key cannot contain NULL and there is only one per table; unique keys allow one NULL and can be multiple
  2. B They are identical
  3. C A unique key cannot contain NULL
  4. D A primary key allows duplicate values
Answer

A primary key cannot contain NULL and there is only one per table; unique keys allow one NULL and can be multiple

Both enforce uniqueness, but a table has exactly one primary key which is also the clustered index in InnoDB, while it may have many unique keys.

All MySQL MCQs

Login to manage your account

Please enter a valid email address.
Forgot Password?
Please enter a valid password.
OR

Don't have an account yet? Sign up as