T4Tutorials .PK

Integrity Constraints MCQs

Q#1: Integrity constraints are used to:
(A) Increase redundancy
(B) Ensure accuracy and consistency of data
(C) Delete data automatically
(D) Speed up queries
Answer: (B) Ensure accuracy and consistency of data

Q#2: Which of the following is an example of an integrity constraint?
(A) PRIMARY KEY
(B) SELECT
(C) INSERT
(D) DROP
Answer: (A) PRIMARY KEY

Q#3: Entity integrity ensures that:
(A) Foreign key is unique
(B) Primary key is not null
(C) All values are null
(D) Tables are merged correctly
Answer: (B) Primary key is not null

Q#4: Referential integrity ensures:
(A) Primary key uniqueness
(B) Foreign key references a valid primary key
(C) Attributes have default values
(D) Tables are normalized
Answer: (B) Foreign key references a valid primary key

Q#5: Domain constraints ensure:
(A) Column values are of the correct type
(B) Rows are unique
(C) Tables are linked
(D) All attributes are primary keys
Answer: (A) Column values are of the correct type

Q#6: NOT NULL constraint ensures that:
(A) Column values cannot be null
(B) Column values must be unique
(C) Column is a primary key
(D) Column is a foreign key
Answer: (A) Column values cannot be null

Q#7: UNIQUE constraint ensures:
(A) All column values are distinct
(B) Column cannot be null
(C) Column references another table
(D) Column is numeric only
Answer: (A) All column values are distinct

Q#8: CHECK constraint is used to:
(A) Validate data based on a condition
(B) Ensure primary key uniqueness
(C) Delete rows
(D) Merge tables
Answer: (A) Validate data based on a condition

Q#9: FOREIGN KEY constraint is used to:
(A) Enforce domain integrity
(B) Enforce referential integrity
(C) Enforce entity integrity
(D) Ensure uniqueness of column
Answer: (B) Enforce referential integrity

Q#10: PRIMARY KEY constraint:
(A) Can have duplicate values
(B) Can be null
(C) Uniquely identifies each row and cannot be null
(D) Must reference another table
Answer: (C) Uniquely identifies each row and cannot be null

Q#11: A table can have:
(A) Multiple primary keys
(B) Only one primary key
(C) No primary key
(D) Multiple foreign keys only
Answer: (B) Only one primary key

Q#12: A foreign key can reference:
(A) Any column
(B) Primary key or unique key in another table
(C) Only numeric column
(D) Only columns with default values
Answer: (B) Primary key or unique key in another table

Q#13: CHECK constraints can be applied to:
(A) Single column or multiple columns
(B) Only one table
(C) Only foreign keys
(D) Only primary keys
Answer: (A) Single column or multiple columns

Q#14: The main purpose of integrity constraints is to:
(A) Reduce table size
(B) Ensure data validity
(C) Improve network speed
(D) Encrypt data
Answer: (B) Ensure data validity

Q#15: DEFAULT constraint is used to:
(A) Provide a default value for a column
(B) Make column unique
(C) Create foreign key
(D) Delete duplicate rows
Answer: (A) Provide a default value for a column

Q#16: ON DELETE CASCADE is used to:
(A) Delete parent row and automatically delete child rows
(B) Delete table structure
(C) Remove null values
(D) Increase redundancy
Answer: (A) Delete parent row and automatically delete child rows

Q#17: ON UPDATE CASCADE ensures:
(A) Updates parent key and automatically updates child keys
(B) Deletes rows
(C) Inserts default values
(D) Prevents table creation
Answer: (A) Updates parent key and automatically updates child keys

Q#18: The combination of multiple columns as a primary key is called:
(A) Simple key
(B) Composite key
(C) Foreign key
(D) Candidate key
Answer: (B) Composite key

Q#19: Entity integrity is violated if:
(A) Foreign key is null
(B) Primary key is null
(C) Column has default value
(D) Table has multiple columns
Answer: (B) Primary key is null

Q#20: Referential integrity is violated if:
(A) Foreign key references a non-existing primary key
(B) Primary key is unique
(C) Column has default value
(D) Table has more than one primary key
Answer: (A) Foreign key references a non-existing primary key

Q#21: A candidate key:
(A) Must be unique and can serve as primary key
(B) Must reference another table
(C) Cannot be null
(D) Is always composite
Answer: (A) Must be unique and can serve as primary key

Q#22: Surrogate keys are:
(A) Natural primary keys
(B) Artificially created keys to serve as primary key
(C) Foreign keys
(D) Composite keys
Answer: (B) Artificially created keys to serve as primary key

Q#23: CHECK constraints use:
(A) Logical conditions
(B) Only numeric values
(C) Only primary key
(D) Only foreign key
Answer: (A) Logical conditions

Q#24: NOT NULL constraint is a type of:
(A) Entity integrity
(B) Referential integrity
(C) Domain integrity
(D) Foreign key
Answer: (C) Domain integrity

Q#25: UNIQUE constraint can allow:
(A) Multiple nulls
(B) Only one null
(C) No null
(D) Duplicate values
Answer: (A) Multiple nulls

Q#26: PRIMARY KEY automatically implies:
(A) NOT NULL and UNIQUE
(B) Foreign key
(C) CHECK constraint
(D) Default value
Answer: (A) NOT NULL and UNIQUE

Q#27: Referential actions include:
(A) CASCADE, SET NULL, RESTRICT
(B) DROP, DELETE, TRUNCATE
(C) SELECT, INSERT, UPDATE
(D) UNIQUE, PRIMARY, CHECK
Answer: (A) CASCADE, SET NULL, RESTRICT

Q#28: ON DELETE RESTRICT prevents:
(A) Deletion of parent row if child rows exist
(B) Deletion of child row
(C) Updating primary key
(D) Inserting duplicate values
Answer: (A) Deletion of parent row if child rows exist

Q#29: Integrity constraints can be defined:
(A) At column level
(B) At table level
(C) Both column and table level
(D) Only in view
Answer: (C) Both column and table level

Q#30: The main benefit of integrity constraints is:
(A) Faster queries
(B) Data consistency and accuracy
(C) Reduced storage
(D) Easier backups
Answer: (B) Data consistency and accuracy

Exit mobile version