Courseiva

DP-900 Practice Question: Identify considerations for relational data on Azure

A company uses Azure SQL Database for a customer relationship management (CRM) application. The database has a table named Orders that stores order details. The company needs to ensure that the OrderDate column is automatically set to the current date and time when a new row is inserted, without any application-side logic. Which T-SQL construct should be used?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

DEFAULT constraint with GETDATE()

A DEFAULT constraint with GETDATE() automatically populates the OrderDate column with the current date and time on each insert, without requiring application-side logic. Option A is incorrect because a CHECK constraint enforces data integrity by validating conditions but does not provide default values. Option B is incorrect because a UNIQUE constraint ensures all values in a column are unique, not auto-populate dates. Option C is incorrect because a PRIMARY KEY constraint uniquely identifies each row and does not set default values.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • CHECK constraint

    Why it's wrong here

    CHECK validates data but does not provide default values.

  • UNIQUE constraint

    Why it's wrong here

    UNIQUE ensures no duplicates, not default values.

  • PRIMARY KEY constraint

    Why it's wrong here

    PRIMARY KEY uniquely identifies rows, does not set default values.

  • DEFAULT constraint with GETDATE()

    Why this is correct

    DEFAULT with GETDATE() automatically inserts current date/time.

About these practice questions

This DP-900 question is part of Courseiva's 820-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DP-900 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-900 exam.