Data Types & Constraints MCQs – CBSE Class 10 Exam Practice
Data Types & Constraints MCQs – CBSE Class 10 Exam Practice
Class: 10
Subject: Computer Science (Code 402)
Unit: Unit 3 – Database Management System (DBMS)
Topic: Data Types & Constraints
Board: CBSE Board Examinations (Based on NCERT Curriculum)
Subject: Computer Science (Code 402)
Unit: Unit 3 – Database Management System (DBMS)
Topic: Data Types & Constraints
Board: CBSE Board Examinations (Based on NCERT Curriculum)
1. Which data type is used to store whole numbers in a database?
Correct Answer: B. INTEGER
INTEGER stores whole numbers without decimal values. It is commonly used for fields like Roll Number, Age, etc. VARCHAR stores text, DATE stores date values, and FLOAT stores decimal numbers.
INTEGER stores whole numbers without decimal values. It is commonly used for fields like Roll Number, Age, etc. VARCHAR stores text, DATE stores date values, and FLOAT stores decimal numbers.
2. Which constraint ensures that a column cannot have NULL values?
Correct Answer: C. NOT NULL
NOT NULL ensures that every record must have a value in that column. It prevents empty or missing entries in important fields.
NOT NULL ensures that every record must have a value in that column. It prevents empty or missing entries in important fields.
3. Which data type is used to store text values?
Correct Answer: B. VARCHAR
VARCHAR stores variable-length text such as names and addresses. It saves space because it only uses the required number of characters.
VARCHAR stores variable-length text such as names and addresses. It saves space because it only uses the required number of characters.
4. Which constraint uniquely identifies each record in a table?
Correct Answer: B. PRIMARY KEY
A PRIMARY KEY uniquely identifies each record and cannot contain NULL values. It ensures data integrity.
A PRIMARY KEY uniquely identifies each record and cannot contain NULL values. It ensures data integrity.
5. Which data type is used for decimal numbers?
Correct Answer: A. FLOAT
FLOAT stores numbers with decimal values such as 85.75. It is useful for marks, percentages, etc.
FLOAT stores numbers with decimal values such as 85.75. It is useful for marks, percentages, etc.
6. Which constraint prevents duplicate values in a column?
Correct Answer: A. UNIQUE
UNIQUE ensures that no two records can have the same value in that column. Example: Email ID.
UNIQUE ensures that no two records can have the same value in that column. Example: Email ID.
7. Which data type stores date values?
Correct Answer: B. DATE
DATE stores date values in a specific format like YYYY-MM-DD. Useful for storing Date of Birth.
DATE stores date values in a specific format like YYYY-MM-DD. Useful for storing Date of Birth.
8. Which constraint sets a default value if none is provided?
Correct Answer: A. DEFAULT
DEFAULT automatically assigns a value if the user does not provide one.
DEFAULT automatically assigns a value if the user does not provide one.
9. Which constraint ensures a value satisfies a specific condition?
Correct Answer: A. CHECK
CHECK enforces rules like Age > 18. It validates data before insertion.
CHECK enforces rules like Age > 18. It validates data before insertion.
10. Which data type stores fixed-length characters?
Correct Answer: B. CHAR
CHAR stores fixed-length text values. It always reserves the specified length.
CHAR stores fixed-length text values. It always reserves the specified length.
11. A FOREIGN KEY is used to:
Correct Answer: B.
FOREIGN KEY creates a relationship between two tables.
FOREIGN KEY creates a relationship between two tables.
12. BOOLEAN data type stores:
Correct Answer: C.
BOOLEAN stores logical values True or False.
BOOLEAN stores logical values True or False.
13. Which constraint automatically prevents NULL and duplicate values?
Correct Answer: C.
PRIMARY KEY ensures uniqueness and non-null values.
PRIMARY KEY ensures uniqueness and non-null values.
14. Data type for storing large text?
Correct Answer: B.
TEXT stores large textual data.
TEXT stores large textual data.
15. Which constraint enforces referential integrity?
Correct Answer: B.
FOREIGN KEY maintains consistency between related tables.
FOREIGN KEY maintains consistency between related tables.
16. Which data type stores time values?
Correct Answer: B.
TIME stores time in HH:MM:SS format.
TIME stores time in HH:MM:SS format.
17. CHECK constraint is mainly used for:
Correct Answer: A.
CHECK restricts values based on a condition.
CHECK restricts values based on a condition.
18. Which data type is suitable for storing phone numbers?
Correct Answer: B.
Phone numbers are stored as text to preserve leading zeros.
Phone numbers are stored as text to preserve leading zeros.
19. DEFAULT constraint is applied when:
Correct Answer: A.
DEFAULT sets a predefined value when no input is provided.
DEFAULT sets a predefined value when no input is provided.
20. Which of the following ensures data integrity?
Correct Answer: A.
Constraints ensure accuracy, validity, and consistency of data.
Constraints ensure accuracy, validity, and consistency of data.
