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

NCERT Solutions PDF Class 12 PDF

This chapter, Database Concepts, delves into the fundamental principles of relational databases. Students will explore the definition of a relation as a table with specific properties, understand the relational data model, and learn about domain names within data attributes. The solutions provide clear explanations and examples for identifying candidate keys and primary keys, differentiating between the cardinality (number of rows) and degree (number of columns) of a table, and applying these concepts to practical scenarios. These NCERT Solutions are designed to help students grasp the core concepts of database management, enabling them to solve problems related to data organization and integrity effectively, which is crucial for their exam preparation.

Quick info

BoardCBSE
ClassClass 12
SubjectComputer Science
Session2026
LanguageEnglish
TypeNCERT Solutions
Chapter11. Database Concepts

Chapter summary

Chapter 11, Database Concepts, focuses on the foundational elements of relational databases. It covers the definition of a relation (table), the relational data model, and the concept of domains. The solutions provide detailed explanations and examples for identifying candidate keys and primary keys, and for distinguishing between cardinality and degree. This chapter is essential for understanding how data is structured and managed in a database system.

Learning outcomes

  • Understand the definition of a relation and the relational data model.
  • Identify possible domain names for attributes like gender.
  • Distinguish between candidate keys and primary keys with examples.
  • Explain and differentiate between the cardinality and degree of a table.
  • Apply the concepts of keys, cardinality, and degree to analyze given tables.

Topics covered

Paper topics

  • Relation
  • Relational Data Model
  • Atomic Values
  • Domain Names
  • Candidate Keys
  • Primary Key
  • Cardinality
  • Degree
  • Table Analysis
  • Data Integrity

Important topics

  • Candidate Keys
  • Primary Key
  • Cardinality vs. Degree
  • Relational Data Model
  • Definition of Relation

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 is a fundamental structure in the relational data model, essentially representing a table. It is characterized by having atomic values (indivisible data) in each of its cells, unique rows (also known as tuples), and unordered rows and columns. The relational data model organizes and represents data, along with the relationships between different pieces of data, through a collection of these tables, where each table is called a relation. Each relation has a set of columns, and each column has a unique name within that relation.

Question 2

What are all the domain names possible in gender?
Solution:

The domain names possible for the 'gender' attribute typically represent the distinct categories of gender. In most common database contexts, these would be:

  • Male
  • Female

These are the specific, allowed values that can be entered into the gender column for any record.

Question 3

Give a suitable example of a table with sample data and illustrate Primary and Candidate Keys in it.
Solution:

A table may contain one or more attributes, or combinations of attributes, that can uniquely identify each row (tuple). Such attributes are called Candidate Keys. From these candidate keys, one is selected to serve as the Primary Key, which is the main identifier for the rows in the table.

Let's consider the 'Stock' table provided:

Candidates Keys Primary Keys Qty.
101 Pen 560
102 Pencil 780
104 CD 450
109 Floopy 700
105 Eraser 300
103 Duster 200

In this 'Stock' table, the column 'Candidates Keys' (which seems to be intended as 'Item Code' or 'Stock ID') uniquely identifies each item. If 'Item Name' were also guaranteed to be unique, it could also be a candidate key. Assuming 'Candidates Keys' is the unique identifier, it would be the Primary Key. If 'Item Name' could potentially have duplicates (e.g., multiple types of 'Pen'), then only 'Candidates Keys' would be a candidate key.

Illustration:

  • Candidate Keys: If 'Candidates Keys' (Item Code) and 'Primary Keys' (Item Name) are both unique, they are both candidate keys.
  • Primary Key: 'Candidates Keys' (Item Code) is selected as the Primary Key because it's a numerical code, often preferred for efficiency.

Question 4

Differentiate between cardinality and degree of a table with the help of an example.
Solution:

The difference between cardinality and degree of a table is as follows:

  • 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 types of data are stored for each record.

Example: Consider the 'Account' table:

Acno Cname
Ac 100 Sheela
Ac 101 Darsh
Ac 102 Kathy

In the 'Account' table:

  • The Cardinality is 3, because there are 3 rows (Sheela, Darsh, Kathy).
  • The Degree is 2, because there are 2 columns (Acno, Cname).

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.

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 that can uniquely identify each row.

  • (i) Candidate Keys: A candidate key is an attribute or set of attributes that can uniquely identify each tuple in a relation. Looking at the table:
    • The 'Id' column contains unique numerical values (101, 104, 105, 109, 103) for each row. Thus, 'Id' can be a candidate key.
    • The 'Product' column contains names like 'Plastic Folder', 'Pen Stand Standard', 'Stapler Medium', etc. Assuming these product descriptions are unique for each entry in this specific table, 'Product' could also potentially serve as a candidate key. However, in real-world scenarios, product names might not always be unique (e.g., different types of 'Stapler'). Based on the provided data, 'Product' appears unique.
    Therefore, the most appropriate columns that can be considered as candidate keys are 'Id' and 'Product'.
  • (ii) Primary Key: The primary key is chosen from the set of candidate keys. It is the key that the database designer selects as the main identifier for the table. Typically, a simple, single-column key like 'Id' is preferred for efficiency and simplicity. In this table, 'Id' is a strong candidate for the primary key as it is a numerical identifier that is guaranteed to be unique for each record.

Conclusion:

  • Candidate Keys: Id, Product
  • Primary Key: Id

Common mistakes

  • Confusing candidate keys with primary keys.
  • Incorrectly identifying the cardinality or degree of a table.
  • Not providing sufficient examples to illustrate concepts.
  • Misunderstanding the atomic value property of relations.

Revision tips

  • Review the definitions of relation, cardinality, and degree carefully.
  • Practice identifying primary and candidate keys in various table examples.
  • Ensure you understand the difference between a candidate key and a primary key.
  • Use the provided examples to reinforce your understanding of table properties.

Practice MCQs

Q1. What is the fundamental structure used to represent data in a relational data model?

Q2. In a table, what does 'cardinality' refer to?

Q3. Which of the following is a set of attributes that can uniquely identify a tuple in a relation?

Q4. If a table has 5 columns, what is its degree?

Q5. Which key is selected from the candidate keys to be the primary identifier for a relation?

Frequently asked questions

What is a relation in the context of database concepts?

A relation, in the relational data model, is essentially a table. It is defined as a structure having atomic values in each cell, unique rows (tuples), and unordered rows and columns.

How do candidate keys and primary keys differ?

A candidate key is any attribute or set of attributes that can uniquely identify a row in a table. A primary key is one of these candidate keys that is specifically chosen to be the main unique identifier for the table.

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.

Can a table have multiple primary keys?

No, a table can only have one primary key. However, it can have multiple candidate keys, from which the primary key is selected.

What are domain names in a database?

Domain names refer to the set of all possible values that an attribute (column) can hold. For example, the domain for a 'gender' attribute might be 'Male' and 'Female'.

How do these NCERT solutions help in exam preparation?

These solutions provide clear, step-by-step explanations and illustrative examples for key database concepts, helping students understand and apply them effectively for their exams.

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

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