CBSE Class 12 Computer Science Chapter 11: Database Concepts NCERT Solutions

NCERT Solutions PDF Class 12 PDF

This chapter delves into the fundamental concepts of database management, specifically focusing on the relational data model. Students will learn to define and understand what a relation (table) is, including its properties like atomic values and unique rows. The solutions explain the concepts of primary keys, candidate keys, and how they uniquely identify records within a table. Furthermore, the distinction between cardinality (number of rows) and degree (number of columns) is clarified with practical examples. These NCERT Solutions provide step-by-step explanations and illustrative examples to help students grasp these core database principles, essential for their upcoming examinations. They serve as a valuable resource for revision and understanding complex database terminology.

Quick info

BoardCBSE
ClassClass 12
SubjectComputer Science (C++)
Session2026
LanguageEnglish
TypeNCERT Solutions
ChapterChapter 11

Chapter summary

Chapter 11, Database Concepts, introduces students to the relational data model. The NCERT Solutions cover key definitions such as 'relation' (table), explaining its structure and properties. It elaborates on identifying unique records using primary and candidate keys, differentiating between them with examples. The chapter also clarifies the concepts of cardinality (number of rows) and degree (number of columns) in a table, providing practical illustrations. These solutions are designed to build a strong foundation in basic database terminology and concepts.

Learning outcomes

  • Understand the definition and structure of a relation in the relational data model.
  • Identify and differentiate between primary keys and candidate keys.
  • Define and differentiate between the cardinality and degree of a table.
  • Apply the concepts of keys to identify unique records in a given table.
  • Illustrate database concepts using suitable examples.

Topics covered

Paper topics

  • Relation
  • Relational Data Model
  • Atomic Values
  • Unique Rows
  • Unordered Rows and Columns
  • Candidate Keys
  • Primary Key
  • Cardinality
  • Degree
  • Table Example
  • Data Identification
  • Database Concepts

Important topics

  • Relation definition
  • Primary Key
  • Candidate Keys
  • Cardinality
  • Degree

PDF preview

Read page by page below. PDF is streamed from the official NCERT website — no download button on this page.

Loading document …
Page of
Loading page …

Questions and Solutions

Question 1

What is a relation? Define the relational data model.
Solution: A relation, in the context of database management systems, is a fundamental structure within the relational data model. It is represented as a table, characterized by having atomic values in each cell, ensuring that each piece of data is indivisible. A relation must also have unique rows (tuples), meaning no two rows are identical. Furthermore, the rows and columns within a relation are considered unordered. The relational data model itself is a way of organizing and representing data and the relationships between different data entities using a collection of these tables, where each table has a distinct set of column names.

Question 2

What are all the domain names possible in gender?
Solution: The domain for the 'gender' attribute typically consists of a predefined set of acceptable values. In most common scenarios, the possible domain names for gender are 'Male' and 'Female'. These are the standard, mutually exclusive categories used to classify individuals based on gender.

Question 3

Give a suitable example of a table with sample data and illustrate Primary and Candidate Keys in it.
Solution: Consider the following 'Stock' table:

In this table, the 'Item Code' column uniquely identifies each item. The 'Item Name' column also appears to uniquely identify each item in this specific sample data. Therefore:

Candidate Keys: Attributes or sets of attributes that can uniquely identify a tuple (row) in a relation. In this example, both 'Item Code' and 'Item Name' can serve as candidate keys because each value in these columns is unique and can identify a specific stock item.

Primary Key: One of the candidate keys is selected as the primary key. The primary key is used to uniquely identify each record in the table. In this case, 'Item Code' is typically chosen as the primary key because it's usually a numerical identifier, which is often more efficient and less prone to changes than a descriptive name.

Thus, 'Item Code' is the primary key, and both 'Item Code' and 'Item Name' are candidate keys.

Question 4

Differentiate between cardinality and degree of a table with the help of an example.
Solution: The terms cardinality and degree are used to describe the dimensions of a table (relation) in a relational database:
  • Cardinality: This refers to the number of rows (or tuples) present in a table. It indicates how many records are stored in the table.
  • Degree: This refers to the number of columns (or attributes) present in a table. It indicates how many different pieces of information are stored for each record.
Let's consider the 'Account' table provided:

Table: Account

The table contains the following columns: 'Acno' and 'Cname'.

The rows shown are: (Ac 100, Sheela), (Ac 101, Darsh), (Ac 102, Kathy).

Based on this example:

Cardinality of Account table: There are 3 rows, so the cardinality is 3.

Degree of Account table: There are 2 columns ('Acno', 'Cname'), so the degree is 2.

Question 5

Observe the following table carefully and write the names of the most appropriate columns, which can be considered as (i) candidate keys and (ii) primary key.

Table Data:

Id | Product | Price | Qty | Transaction Date

101 | Plastic Folder | 12" | 3400 | 100 | 2014-12-14

104 | Pen Stand Standard | 4500 | 200 | 2015-01-31

105 | Stapler Medium | 1200 | 250 | 2015-02-28

109 | Punching Machine Big | 1400 | 200 | 2015-03-12

103 | Stapler Mini | 1500 | 100 | 2015-02-02

Solution: To identify the candidate keys and primary key, we need to find columns or combinations of columns that uniquely identify each row.
  • (i) Candidate Keys: A candidate key is an attribute or a set of attributes that can uniquely identify a row. Let's examine the columns:
    • 'Id': Each value in the 'Id' column (101, 104, 105, 109, 103) is unique and can identify a specific transaction record.
    • 'Product': The 'Product' column contains values like 'Plastic Folder', 'Pen Stand Standard', 'Stapler Medium', 'Punching Machine Big', 'Stapler Mini'. In this specific data, each product name is unique. If it's guaranteed that each product name will always be unique for each transaction, then 'Product' could also be a candidate key. However, 'Id' is generally a more reliable unique identifier.
    • Other columns like 'Price', 'Qty', 'Transaction Date' do not uniquely identify rows on their own (e.g., 'Qty' has duplicate values '200' and '100').
    Therefore, the most appropriate columns that can be considered as candidate keys are 'Id' and potentially 'Product' (assuming product names are unique per transaction).
  • (ii) Primary Key: The primary key is one of the candidate keys selected to be the main unique identifier for the table. Typically, a simple, non-null, and stable attribute is chosen. In this table, 'Id' is the most suitable choice for the primary key as it is a numerical identifier that is guaranteed to be unique for each transaction record.

Common mistakes

  • Confusing candidate keys with primary keys.
  • Incorrectly identifying the number of rows (cardinality) or columns (degree).
  • Not understanding the requirement for unique identification of records.
  • Misinterpreting the atomic value constraint in a relation.

Revision tips

  • Focus on understanding the definitions of relation, cardinality, and degree.
  • Practice identifying primary and candidate keys in various table examples.
  • Review the provided examples to solidify your understanding of key concepts.
  • Attempt to create your own simple tables and identify their keys, cardinality, and degree.

Practice MCQs

Q1. In the relational data model, what is a table commonly referred to as?

Q2. Which of the following best describes the 'degree' of a table?

Q3. What is the primary purpose of a primary key in a table?

Q4. If a table has 5 rows and 3 columns, what are its cardinality and degree?

Q5. Which of the following is a characteristic of a relation (table) in the relational model?

Frequently asked questions

What is a relation in the context of database concepts?

In the relational data model, a relation is essentially a table. It is defined as a table that contains atomic values, has unique rows, and its rows and columns are unordered.

What is the difference between cardinality and degree of a table?

Cardinality refers to the number of rows (tuples) in a table, while the degree refers to the number of columns (attributes) in the table.

How are primary keys and candidate keys related?

A table can have multiple candidate keys, which are attributes or sets of attributes that can uniquely identify a row. Out of these candidate keys, one is chosen to be the primary key.

Why is it important to have unique keys like primary keys in a database table?

Unique keys ensure that each record in the table can be distinctly identified, preventing data redundancy and allowing for accurate data retrieval and manipulation.

Are the rows and columns in a relation ordered?

According to the relational data model, the rows (tuples) and columns (attributes) of a relation are considered unordered.

What does it mean for values in a relation to be atomic?

Atomic values mean that each cell in the table contains a single, indivisible piece of data. For example, a column for 'Name' should not store 'First Name, Last Name' in a single cell.

Content reviewed by the NCERT Help team. Editorial Team and update policy

NCERT Solutions PDF PDF on NCERT Help. URL unchanged for search indexing.