CBSE Class 12 Computer Science Chapter 6: Database Concepts NCERT Solutions
CBSE Class 12 Computer Science chapter 6, Database Concepts, introduces the foundational elements of database management. This section of the NCERT Solutions clarifies essential RDBMS operations, including the Cartesian Product, and explains how to determine the Degree and Cardinality of tables. It also covers the UNION operation and the critical criteria for selecting a primary key. These solutions are designed to break down complex database principles into understandable components, making them an excellent study aid for students. By providing clear explanations and practical examples, this chapter aims to solidify students' understanding of database concepts, preparing them effectively for their examinations and building confidence in their problem-solving abilities.
Quick info
| Board | CBSE |
|---|---|
| Class | Class 12 |
| Subject | Computer Science |
| Session | 2026 |
| Language | English |
| Type | NCERT Solutions |
| Chapter | 6. Database Concepts |
Chapter summary
Chapter 6, Database Concepts, focuses on foundational RDBMS principles. This NCERT Solutions set clarifies essential terms like Degree and Cardinality, demonstrating their calculation with examples. It explains the purpose and application of the Cartesian Product and UNION operations between tables. The solutions also critically examine the suitability of attributes as primary keys, highlighting the importance of uniqueness. This chapter's exercises are designed to build a solid understanding of relational database structure and operations.
Learning outcomes
- Understand the concept of Cartesian Product in RDBMS.
- Define and calculate the Degree and Cardinality of a given table.
- Identify suitable attributes for a Primary Key.
- Explain the UNION operation between two tables.
- Apply database concepts to analyze given table structures and outputs.
Topics covered
Paper topics
- RDBMS Operations
- Cartesian Product
- Degree of a Table
- Cardinality of a Table
- Primary Key
- Table Attributes
- Table Tuples
- UNION Operation
- Data Redundancy
- Relational Algebra Concepts
Important topics
- Degree and Cardinality Calculation
- Identifying Primary Keys
- Understanding Cartesian Product
- Concept of UNION Operation
- RDBMS Table Structure
PDF preview
Read page by page below. PDF is streamed from the official NCERT website — no download button on this page.
Questions and Solutions
Question 1
PARTICIPANTS Table:
NO. Name
1 Aruanabha Tariban
2 John Fedricks
3 Kanti Desai
EVENTS Table:
EVENTCODE EVENTNAME
1001 IT Quiz
1002 Group Debate
RESULT:
No. Name EVENTCODE EVENTNAME
1 Aruanabha Tariban 1001 IT Quiz
1 Aruanabha Tariban 1002 Group Debate
2 John Fedricks 1001 IT Quiz
2 John Fedricks 1002 Group Debata
3 Kanti Desai 1001 IT Quiz
3 Kanti Desai 1002 Group Debata
The RDBMS operation used to produce the RESULT is the Cartesian Product. This operation combines each row from the first table (PARTICIPANTS) with each row from the second table (EVENTS).
To find the Degree and Cardinality of the RESULT table:
- Degree: The degree is the number of columns in the RESULT table. The RESULT table has columns: No., Name, EVENTCODE, EVENTNAME. Therefore, the Degree is 4.
- Cardinality: The cardinality is the number of rows in the RESULT table. The PARTICIPANTS table has 3 rows, and the EVENTS table has 2 rows. The Cartesian Product results in (Number of rows in PARTICIPANTS) * (Number of rows in EVENTS) = 3 * 2 = 6 rows. Therefore, the Cardinality is 6.
Answer: Cartesian Product, Degree = 4, Cardinality = 6
Question 2
Table: Patients PatNo PatName Dept DocID 1 Leena ENT 100 2 Supreeth Ortho 200 3 Madhu ENT 100 4 Neha ENT 100 5 Deepak Ortho 200
Degree: The degree of a relation (or table) is defined as the number of attributes (columns) it contains. In simpler terms, it's the count of columns in the table.
Cardinality: The cardinality of a relation (or table) is defined as the number of tuples (rows or records) it contains. In simpler terms, it's the count of rows in the table.
For the given 'Patients' table:
- The attributes are PatNo, PatName, Dept, and DocID. There are 4 attributes. So, the Degree = 4.
- The tuples (rows) are: (1, Leena, ENT, 100), (2, Supreeth, Ortho, 200), (3, Madhu, ENT, 100), (4, Neha, ENT, 100), (5, Deepak, Ortho, 200). There are 5 tuples. So, the Cardinality = 5.
Answer: Degree = 4, Cardinality = 5
Question 3
Table: Store Item Code Item Qty Rate 10 Gel Pen Classic 1150 25 11 Sharpener 1500 10 12 Ball Pen 0.5 1600 12 13 Eraser 1600 5 15 Ball Pen 0.25 800 20
- In the above table, can we have Qty as primary key?
- What is the cardinality and degree of the above table?
- Can Qty be a primary key? No, we cannot have 'Qty' as the primary key in the 'Store' table. A primary key must uniquely identify each record in a table, meaning each value in the primary key column must be distinct. In the given 'Store' table, the 'Qty' column has values 1500 (for Item Code 11) and 1600 (for Item Code 12 and 13), which are duplicated. Since primary keys cannot have duplicate values, 'Qty' is not a suitable primary key. 'Item Code' would be a more appropriate primary key as it appears to be unique for each item.
- Cardinality and Degree:
- Degree: The degree is the number of columns in the table. The table has columns: Item Code, Item, Qty, Rate. Therefore, the Degree is 4. ()
- Cardinality: The cardinality is the number of rows in the table. There are 5 rows representing 5 different items. Therefore, the Cardinality is 5. ()
Question 4
The UNION operation in relational database management systems (RDBMS) is used to combine the result sets of two or more SELECT statements. It merges rows from multiple tables into a single result set. A key characteristic of the UNION operation is that it automatically removes duplicate rows from the combined result.
Conditions for UNION:
- The tables involved must have the same number of columns.
- The corresponding columns in each table must have compatible data types. For example, you can combine a column of integers with another column of integers, or text with text.
- The order of the columns matters. The first column of the first SELECT statement is combined with the first column of the second SELECT statement, and so on.
Example:
Consider two tables, Employees and Contractors, both having columns EmpID and Name.
Employees Table:
| EmpID | Name |
| 101 | Alice |
| 102 | Bob |
Contractors Table:
| EmpID | Name |
| 201 | Charlie |
| 101 | Alice |
To get a combined list of all unique employee and contractor IDs and their names, we can use the UNION operation:
SELECT EmpID, Name FROM Employees
UNION
SELECT EmpID, Name FROM Contractors;
The result of this UNION operation would be:
| EmpID | Name |
| 101 | Alice |
| 102 | Bob |
| 201 | Charlie |
Notice that the row (101, Alice) appears only once in the result, as UNION removes duplicates.
Common mistakes
- Confusing Degree and Cardinality definitions.
- Incorrectly calculating Degree or Cardinality for a table.
- Assuming an attribute with duplicate values can be a Primary Key.
- Misunderstanding the conditions for performing a UNION operation.
Revision tips
- Focus on understanding the definitions of Degree and Cardinality before attempting calculations.
- Practice identifying the correct RDBMS operation for given table manipulations.
- Review the criteria for a Primary Key and apply them to different table scenarios.
- Use the examples provided to visualize the results of UNION operations.
Practice MCQs
Q1. Which RDBMS operation combines rows from two tables, creating all possible pairs of rows?
Explanation: The Cartesian Product operation generates a result set containing all possible combinations of rows from the participating tables.
Q2. What does the 'Degree' of a table represent?
Explanation: The Degree of a table is defined as the count of its attributes or columns.
Q3. If a table has 5 rows and 4 columns, what is its Cardinality and Degree respectively?
Explanation: Cardinality refers to the number of rows (tuples), which is 5, and Degree refers to the number of columns (attributes), which is 4.
Q4. Can 'Qty' be a primary key in the 'Store' table if it has values like 1500, 1500, 1600, 1600, 800?
Explanation: A primary key must have unique values. Since 'Qty' has duplicate values (1500 and 1600 appear more than once), it cannot serve as a primary key.
Q5. The UNION operation in SQL combines rows from two tables. What is a key requirement for this operation?
Explanation: For a UNION operation, the selected columns from both tables must have the same number and compatible data types.
Frequently asked questions
What is the difference between Degree and Cardinality in a database table?
Degree refers to the number of columns (attributes) in a table, while Cardinality refers to the number of rows (tuples) in a table.
Can a primary key have duplicate values?
No, a primary key must contain unique values to uniquely identify each row in a table. Duplicate values are not allowed.
What is the purpose of the Cartesian Product operation?
The Cartesian Product operation is used to combine rows from two tables, producing all possible pairs of rows. It's often a preliminary step before more specific joins.
What are the conditions for performing a UNION operation between two tables?
The tables involved in a UNION operation must have the same number of columns, and the corresponding columns must have compatible data types.
How do these NCERT Solutions help with exam preparation for Database Concepts?
These solutions provide clear, rewritten explanations and step-by-step problem-solving for key concepts like Degree, Cardinality, and RDBMS operations, reinforcing understanding and aiding revision.
What is the significance of analyzing the 'Store' table in Question 3?
Question 3 uses the 'Store' table to illustrate why 'Qty' cannot be a primary key due to duplicate values and to reinforce the calculation of Degree and Cardinality.
Content reviewed by the NCERT Help team. Editorial Team and update policy
NCERT Solutions PDF PDF on NCERT Help. URL unchanged for search indexing.