Database & Data Handling (NCCIA) MCQs
1999 MCQs is category mein available hain.
All MCQs in Database & Data Handling (NCCIA)
311 Which of the following is a valid use of the CHECK constraint?
Explanation
- CHECK (Salary > 0) enforces a valid range for salary.
- Uniqueness is UNIQUE, linking is FOREIGN KEY and emptiness is NOT NULL.
Last verified on 27-11-2026
312 In SQL, which data type stores approximate floating-point numbers?
Explanation
- FLOAT stores approximate floating-point numbers.
- DECIMAL stores exact decimal values and is preferred for money.
Last verified on 27-11-2026
313 Why is DECIMAL preferred over FLOAT for money?
Explanation
- DECIMAL gives exact decimal arithmetic, avoiding the rounding errors of binary floating-point.
- Money calculations must be exact.
Last verified on 27-11-2026
314 What does the length in VARCHAR(50) mean?
Explanation
- VARCHAR(50) allows up to 50 characters.
- Shorter values use less storage than the maximum.
Last verified on 27-11-2026
315 Which constraint is automatically created when a column is declared as PRIMARY KEY?
Explanation
- A primary key creates a unique index to enforce uniqueness efficiently.
- It also enforces NOT NULL on the key columns.
Last verified on 27-11-2026
316 Which constraint ensures that a column cannot contain duplicate values?
Explanation
- UNIQUE prevents duplicate values in a column.
- NOT NULL only prevents missing values and CHECK limits allowed values.
Last verified on 27-11-2026
317 If a column has both UNIQUE and NOT NULL constraints, what is true?
Explanation
- NOT NULL requires a value and UNIQUE requires all values to differ.
- Together they behave like a candidate key.
Last verified on 27-11-2026
318 Which constraint ensures that every row has a value in a column?
Explanation
- NOT NULL forbids missing values in a column.
- UNIQUE allows one NULL in many systems and does not require a value.
Last verified on 27-11-2026
319 Which data type is suitable for storing a phone number such as 03001234567?
Explanation
- A phone number is stored as text because leading zeros matter and no arithmetic is done on it.
- INT would drop the leading zero.
Last verified on 27-11-2026
320 What does a PRIMARY KEY constraint guarantee?
Explanation
- A primary key uniquely identifies each row and cannot contain NULL.
- It combines uniqueness with NOT NULL.
Last verified on 27-11-2026