QuestionQ18

Design and develop database solutions

You have an Azure SQL database containing a table named Rooms. The Rooms table was created by using the following Transact-SQL statement.

Question Image

You find that some records in the Rooms table have NULL values in the Owner field.

You need to ensure that every future record includes a value for the Owner field.

What should you add?

Explanation

A CHECK constraint such as CHECK (Owner IS NOT NULL) rejects future inserts or updates whose Owner value is NULL. CHECK constraints enforce domain integrity by limiting the values permitted in a column, whereas a unique constraint does not require a non-NULL value.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!