quiz

Full-stack dev quiz question #59

Full-stack dev quiz question #59quiz

Null values in relational databases are special in many ways. Do two nulls violate uniqueness? Check fifty ninth question of full-stack dev quiz to check if you know how to play with null values.

Consider a table BOOKS with BOOK_HASH column created in MySQL. There is a unique constraint created on the BOOK_HASH column. It is the only column in that unique constraint.

Which sentences are true? Choose all valid answers.

  1. null value is defined as the absence of any data value by ISO SQL standard
  2. two null values can be inserted to the BOOK_HASH column if the column is numeric
  3. two null values can be inserted to the BOOK_HASH column if the column is varchar
  4. unique constraint allows two null values, but a unique index does not
  5. the BOOK_HASH column cannot contain any null value, because all values must be unique, but null can mean any value
  6. a unique index is automatically created on the BOOK_HASH column by MySQL engine, because it has a unique constraint

For the correct answer scroll down

.

.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

.

.

.

The correct answer is: a, b, c, f. If you would like to read more, check MySQL unique index with null values article.

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.