AMP

Chapter-8 Database Concepts — Online MCQ Test

COMPUTER SCIENCE · CLASS 12 SECOND PUC · Karnataka State Board
Practice Chapter-8 Database Concepts with a free chapter-wise online MCQ test. This chapter covers: relational model - primary key - candidate key - foreign key - attributes - tuples - cardinality - degree. AI-generated questions from basic to board-exam level, with instant results and explanations.

Start Exam on Full Site →

Chapter-8 Database Concepts — Important Questions & Answers

What is a relation in the relational model?
  • A. A mathematical concept represented as a table with rows and columns
  • B. A connection between two databases
  • C. A type of primary key constraint
  • D. A method of organizing files sequentially
Answer: A. A mathematical concept represented as a table with rows and columns
In the relational model, a relation is a table consisting of rows (tuples) and columns (attributes) that represent data.
Which of the following is the definition of a tuple?
  • A. A column in a relational table
  • B. A row in a relational table
  • C. A data type used in databases
  • D. A constraint applied to attributes
Answer: B. A row in a relational table
A tuple is a single row in a relational table that contains a set of attribute values.
In a Student table with columns (StudentID, Name, Email, Phone), what is the degree of this relation?
  • A. 1
  • B. 2
  • C. 3
  • D. 4
Answer: D. 4
The degree is the number of attributes (columns), which are StudentID, Name, Email, and Phone = 4 attributes.
Analyze this situation: Table Course has CourseID as primary key. Table Enrollment has StudentID, CourseID. CourseID in Enrollment is marked as foreign key. What constraint is being enforced?
  • A. Entity integrity only
  • B. Referential integrity only
  • C. Both entity and referential integrity
  • D. Domain integrity only
Answer: B. Referential integrity only
The foreign key CourseID enforces referential integrity by ensuring every CourseID in Enrollment exists in the Course table's primary key.
[TRICKY] In a table with attributes (EmployeeID, Email, PhoneNumber), if Email is NULL for some records and PhoneNumber for others, but EmployeeID is always non-NULL and unique, then:
  • A. Email or PhoneNumber could individually serve as a primary key
  • B. Only EmployeeID can be a primary key due to NULL values in other attributes
  • C. A composite key of (Email, PhoneNumber) is better than EmployeeID alone
  • D. No primary key can be established for this table
Answer: B. Only EmployeeID can be a primary key due to NULL values in other attributes
Primary keys cannot contain NULL values; therefore, only EmployeeID with guaranteed uniqueness and non-NULL values can be the primary key.