Database concepts Quiz Class 12

๐Ÿ—„๏ธ Database Concepts Quiz โ€” Class 12 Computer Science (Code 083)

Practice 20 CBSE Class 12 Computer Science (Code 083) MCQs on database concepts and the relational data model โ€” what a database and DBMS are, data integrity, relations, attributes, tuples, domain, degree, cardinality, and keys (candidate key, primary key, alternate key, foreign key).

Every answer below has been checked for accuracy, including a correction where the original definitions of โ€œcandidate keyโ€ and โ€œprimary keyโ€ were worded identically, making them indistinguishable. Tap any question to reveal the answer with a clear explanation.

๐Ÿ—„๏ธ Database Basics๐Ÿ“‹ Relational Model๐Ÿ”‘ Keys
Q1
๐Ÿ—„๏ธ Database Basics

What is a database?

  1. A structured collection of data
  2. A collection of files on a computer
  3. A type of computer programming language
  4. A graphical user interface
Show Answer & Explanation

โœ… Answer: (a) A structured collection of data

A database is a structured collection of data, organized so it can be efficiently stored, accessed, managed, and updated โ€” much more than just a loose folder of files.

Q2
๐Ÿ—„๏ธ Database Basics

Why is a database needed in the context of information management?

  1. To slow down data access
  2. To limit data storage
  3. To prevent data retrieval
  4. To centralize and organize data
Show Answer & Explanation

โœ… Answer: (d) To centralize and organize data

Databases exist to centralize and organize data โ€” bringing scattered information into one well-structured system that’s easy to search, update, and keep consistent, rather than spread across disconnected files.

Q3
๐Ÿ—„๏ธ Database Basics

What is the primary purpose of a database management system (DBMS)?

  1. To create computer programs
  2. To facilitate internet communication
  3. To manage and organize data in a database
  4. To design hardware components
Show Answer & Explanation

โœ… Answer: (c) To manage and organize data in a database

A DBMS is the software layer that lets users and applications create, manage, query, and organize data stored in a database โ€” examples include MySQL, Oracle, and PostgreSQL.

Q4
๐Ÿ—„๏ธ Database Basics

In the context of databases, what is data integrity?

  1. The process of encrypting data
  2. The accuracy and consistency of data
  3. The speed of data retrieval
  4. The amount of data storage
Show Answer & Explanation

โœ… Answer: (b) The accuracy and consistency of data

Data integrity refers to keeping data accurate and consistent throughout its lifecycle โ€” ensuring, for example, that a value in one table correctly matches related data elsewhere, with no contradictions or corruption.

Q5
๐Ÿ—„๏ธ Database Basics

How does a relational database differ from a simple, unstructured collection of files?

  1. It uses a table-based structure to organize data
  2. It stores data without any structure at all
  3. It stores everything in a single, undivided file
  4. It doesn’t allow any data retrieval
Show Answer & Explanation

โœ… Answer: (a) It uses a table-based structure to organize data

A relational database organizes data into structured tables (rows and columns), with defined relationships between them โ€” a far more organized and query-friendly approach than loose, unstructured files.

Q6
๐Ÿ“‹ Relational Model

What is a relation in the context of the relational data model?

  1. The connection between two databases
  2. The process of data retrieval
  3. The encryption of data
  4. A table that stores data
Show Answer & Explanation

โœ… Answer: (d) A table that stores data

In relational database terminology, a relation is simply the formal term for a table โ€” a structured collection of rows (tuples) and columns (attributes).

Q7
๐Ÿ“‹ Relational Model

In a relational data model, what is an attribute?

  1. A condition for data retrieval
  2. A column or field in a table
  3. A foreign key linking tables
  4. The encryption key for data
Show Answer & Explanation

โœ… Answer: (b) A column or field in a table

An attribute is a column (field) in a table โ€” representing one specific property of the data, like โ€œNameโ€ or โ€œAgeโ€ in a Students table.

Q8
๐Ÿ“‹ Relational Model

What is a tuple in the context of the relational data model?

  1. A type of data encryption
  2. A row or record in a table
  3. A query language for databases
  4. A primary key in a table
Show Answer & Explanation

โœ… Answer: (b) A row or record in a table

A tuple is a single row (record) in a table โ€” representing one complete entry, like one specific student’s full set of details.

Q9
๐Ÿ“‹ Relational Model

Define the term โ€œdomainโ€ as it relates to the relational data model.

  1. The set of allowed values for an attribute
  2. The connection between tables
  3. The total number of tuples in a table
  4. The process of data insertion
Show Answer & Explanation

โœ… Answer: (a) The set of allowed values for an attribute

A domain is the set of all permissible values an attribute can take โ€” e.g. the domain for a โ€œGenderโ€ column might be restricted to just โ€œMโ€ or โ€œFโ€.

Q10
๐Ÿ“‹ Relational Model

What does the โ€œdegreeโ€ of a relation represent?

  1. The level of encryption
  2. The number of attributes in a relation
  3. The number of tuples in a relation
  4. The process of data deletion
Show Answer & Explanation

โœ… Answer: (b) The number of attributes in a relation

The degree of a relation is simply the number of columns (attributes) it has โ€” e.g. a table with 5 columns has a degree of 5.

Q11
๐Ÿ“‹ Relational Model

In the relational data model, what is cardinality?

  1. The process of data retrieval
  2. The speed of data access
  3. The number of relationships in a database
  4. The number of tuples in a relation
Show Answer & Explanation

โœ… Answer: (d) The number of tuples in a relation

Cardinality is the number of rows (tuples) a relation contains โ€” e.g. a table with 100 records has a cardinality of 100.

Q12
๐Ÿ”‘ Keys

What is a candidate key in a relational database?

  1. An attribute with encrypted values
  2. A key used for data retrieval
  3. An attribute (or set of attributes) that COULD uniquely identify each tuple in a table
  4. The primary table in a database
Show Answer & Explanation

โœ… Answer: (c) An attribute (or set of attributes) that COULD uniquely identify each tuple in a table

A candidate key is any attribute (or combination) capable of uniquely identifying every row โ€” a table can have multiple candidate keys, each a valid โ€œcandidateโ€ for becoming the table’s primary key.

Q13
๐Ÿ”‘ Keys

Define the term โ€œprimary keyโ€ in the context of the relational data model.

  1. The candidate key that is specifically CHOSEN to be the main unique identifier for a table
  2. Any attribute in the table, regardless of uniqueness
  3. A secondary table in a database
  4. The number of attributes in a relation
Show Answer & Explanation

โœ… Answer: (a) The candidate key that is specifically CHOSEN to be the main unique identifier for a table

A primary key is the one candidate key selected by the database designer to serve as the table’s official unique identifier. (This question is corrected from a version whose definition โ€” โ€œa unique identifier for a tupleโ€ โ€” was identical, word for word, to the definition given for โ€œcandidate keyโ€, making the two concepts indistinguishable. The real distinction is that a table can have several candidate keys, but only one of them is chosen as the primary key.)

Q14
๐Ÿ”‘ Keys

What is an alternate key in the relational data model?

  1. An attribute with encrypted values
  2. A key used for data retrieval
  3. A candidate key that is NOT selected as the primary key
  4. The process of data deletion
Show Answer & Explanation

โœ… Answer: (c) A candidate key that is NOT selected as the primary key

An alternate key is simply any candidate key that wasn’t chosen to be the primary key โ€” it could still uniquely identify rows, but the primary key role went to a different candidate instead.

Q15
๐Ÿ”‘ Keys

In the relational data model, what is a foreign key?

  1. A key used for data retrieval
  2. A unique identifier for a tuple in a table
  3. An attribute with encrypted values
  4. A field that links to the primary key in another table
Show Answer & Explanation

โœ… Answer: (d) A field that links to the primary key in another table

A foreign key is an attribute in one table that references the primary key of another table โ€” this is exactly how relational databases establish relationships between different tables.

Q16
๐Ÿ”‘ Keys

Can a single table have more than one candidate key, but only one primary key?

  1. No, a table can only ever have exactly one candidate key
  2. Yes โ€” a table may have several candidate keys, but the designer selects only ONE of them to serve as the primary key
  3. No, every candidate key automatically becomes a primary key
  4. Yes, but a table can also have multiple primary keys simultaneously
Show Answer & Explanation

โœ… Answer: (b) Yes โ€” a table may have several candidate keys, but the designer selects only ONE of them to serve as the primary key

This is exactly right: a table can have multiple candidate keys (each independently capable of uniquely identifying rows), but the designer picks just one to be the primary key โ€” the rest become alternate keys.

Q17
๐Ÿ”‘ Keys

Can a primary key column contain NULL (empty/missing) values?

  1. Yes, primary keys can contain NULL values freely
  2. No โ€” a primary key must always have a value for every row, and cannot be NULL
  3. Only the first row’s primary key can be NULL
  4. It depends entirely on the programming language used
Show Answer & Explanation

โœ… Answer: (b) No โ€” a primary key must always have a value for every row, and cannot be NULL

A core rule of the relational model is that a primary key can never be NULL โ€” since its whole job is to uniquely identify every row, allowing it to be empty would break that guarantee.

Q18
๐Ÿ“‹ Relational Model

A table named โ€œStudentsโ€ has 6 columns (Roll No, Name, Class, Section, Marks, Grade) and currently holds 40 rows of student records. What are its degree and cardinality?

  1. Degree = 40, Cardinality = 6
  2. Degree = 6, Cardinality = 40
  3. Degree = 6, Cardinality = 6
  4. Degree = 40, Cardinality = 40
Show Answer & Explanation

โœ… Answer: (b) Degree = 6, Cardinality = 40

Degree counts the columns (attributes) โ€” there are 6. Cardinality counts the rows (tuples) โ€” there are 40. So Degree = 6, Cardinality = 40.

Q19
๐Ÿ”‘ Keys

What is the primary purpose of a foreign key in maintaining data across tables?

  1. To encrypt sensitive data across tables
  2. To maintain referential integrity by linking related records between two tables
  3. To speed up data retrieval by removing all relationships
  4. To automatically delete data from the referenced table
Show Answer & Explanation

โœ… Answer: (b) To maintain referential integrity by linking related records between two tables

A foreign key’s main job is to maintain referential integrity โ€” ensuring that a value in one table (like a โ€œStudentIDโ€ in a Marks table) actually corresponds to a real, existing record in the table it references (the Students table), preventing orphaned or inconsistent data.

Q20
๐Ÿ—„๏ธ Database Basics

Which of the following is a genuine benefit of using a DBMS over storing data in plain, unstructured files?

  1. It guarantees data is always 100% impossible to lose
  2. It reduces data redundancy and helps maintain consistency across related data
  3. It eliminates the need for any data backup ever
  4. It makes data completely inaccessible to any user
Show Answer & Explanation

โœ… Answer: (b) It reduces data redundancy and helps maintain consistency across related data

One of the biggest advantages of a DBMS is reducing data redundancy (avoiding the same information being duplicated inconsistently in multiple places) and maintaining consistency, since related data is properly linked through keys rather than copy-pasted everywhere.

Jitendra Singh
โœ” Verified Educator

Jitendra Singh

Founder of CBSEPython.in

I help CBSE Class 9โ€“12 students learn Python, Information Technology, Artificial Intelligence and Computer Science through easy notes, quizzes, MCQs and sample papers.

Read More About Me โ†’