The NCERT Solutions for Class 12 Computer Science Chapter 8 Database Concepts solve all 13 exercise questions, mapped to the latest 2026-27 CBSE syllabus. Every answer follows the textbook's own flow: why a relational DBMS beats a file system, how a relation is built from tuples and attributes, and how keys and constraints keep the stored data correct.

  • All 13 NCERT questions solved with worked reasoning, table answers, and an Expert Solution per question that adds exam strategy and common-trap warnings.
  • Full coverage of candidate, primary, alternate and foreign keys, NULL values, degree and cardinality, and the integrity constraints that the CBSE board paper tests directly.
  • Answers aligned with the 2026-27 CBSE Class 12 Computer Science syllabus and useful for CUET and JEE-level database questions.
Database Concepts Class 12 Computer Science Chapter 8 NCERT Solutions

Every answer in this Collegedunia compilation is curated by Computer Science subject experts, mapped to the 2026-27 NCERT textbook, and refined against the last five years of CBSE Class 12 Computer Science board papers.

Student Feedback: What 9,800 students told us about this chapter

71% of Class 12 students said telling apart candidate, primary, alternate and foreign keys was the hardest part of the Database Concepts chapter. 3 out of 5 students told us they lost marks by writing "primary key" when the question asked for a candidate key.

Toppers found that answering every "differentiate" question in a two-column table added 1 to 2 marks, and the average student spent 2 to 3 hours on this chapter across the first read and exercise practice.

Source: 2026-27 Class 12 Computer Science student poll. Sample of 9,800 students from CBSE schools across 12 states, conducted before the 2026 boards.

What the NCERT Solutions for Class 12 Computer Science Chapter 8 Database Concepts Cover

This chapter answers one big question: why store data in a proper database instead of plain files, and how do you keep that data correct? The NCERT book builds the answer in clear blocks, and these solutions stay faithful to that order while filling the gaps students hit in the exam.

  • File system vs DBMS: a relational DBMS removes the redundancy, inconsistency and weak integrity that plain files suffer from.
  • The relational model: data is stored in relations (tables) made of tuples (rows) and attributes (columns), where row order and column order do not matter.
  • Keys: candidate, primary, alternate and foreign keys, plus how each one identifies or links rows.
  • Constraints and NULL: entity integrity, referential integrity, NOT NULL and CHECK, and what a NULL value really means.

Source: Magnet Brains on YouTube

Exercise-wise Breakdown of the Database Concepts Chapter NCERT Solutions

Chapter 8 of NCERT Class 12 Computer Science carries 13 end-of-chapter exercise questions. The table below maps each question to its topic, the answer style CBSE rewards, and the typical mark weight students see in the board paper.

QuestionTopic coveredAnswer styleTypical marks
Q 1Give the term: database, metadata, candidate key, NULL, alternate key, RDBMSOne exact term per part1 mark each (6 parts)
Q 2Why a foreign key may be NULL, with an exampleRule plus a worked example2 to 3 marks
Q 3Differentiate schema vs state, primary vs foreign key, degree vs cardinalityTwo-column table per pair3 marks each pair
Q 4 and Q 5How a DBMS removes redundancy; file-system limits a DBMS overcomesProblem to cure mapping3 to 5 marks
Q 6 and Q 7Sports preference tables: entity integrity, NULL, relation as a setReasoned yes or no per part3 to 4 marks
Q 8Design a canteen database (ITEM and BILL tables)Schema with keys and data types4 to 5 marks
Q 9 to Q 13Find candidate, primary, alternate and foreign keys; check insert validityKey spotting and constraint check3 to 5 marks

The design question (Q 8) and the key-spotting questions (Q 9 to Q 13) carry the heaviest marks. Students who name the exact key type and pair each rule with its integrity name score full marks.

Candidate primary alternate and foreign keys in a relational database for Class 12 Computer Science Chapter 8

File System vs DBMS: Redundancy, Inconsistency and Integrity

A file system stores data in separate, application-owned files, so the same fact gets copied into many files. A relational DBMS stores data once in a central shared database and uses normalisation to split data into related tables linked by keys. This single change removes most of the file system's problems.

  • Data redundancy: the same data copied across files. The DBMS keeps each fact once, linked by a small key.
  • Data inconsistency: duplicate copies disagree after an update. With one copy, an update made once is seen everywhere.
  • Poor data integrity: a plain file accepts wrong data. Constraints (primary key, foreign key, NOT NULL, CHECK) enforce valid data.
  • Hard access, weak security, poor backup: SQL, per-user permissions and built-in recovery fix all three.
Watch Out: Do not mix up redundancy and inconsistency. Redundancy is storing the same fact twice; inconsistency is when those two copies drift apart. Removing redundancy removes the root cause of inconsistency.

The trick that removes redundancy is storing only a small key (like Roll_no) in the other tables instead of the full record. The key points back to the one place the details live, so nothing bulky is repeated.

File system versus DBMS comparison for Class 12 Computer Science Chapter 8 Database Concepts

Relation, Tuple, Attribute, Degree and Cardinality

A relation is a table of rows and columns. Each row is a tuple (a record), and each column is an attribute (a field). A relation is formally a set of tuples, which is why the order of rows and the order of columns do not matter, as Question 7 shows.

TermMeaningQuick example
TupleOne row, a single record in the table(9, Cricket)
AttributeOne column, a named fieldRoll_no, Preference
DegreeNumber of attributes (columns)A 4-column table has degree 4
CardinalityNumber of tuples (rows)A 10-row table has cardinality 10

Tip: Degree counts columns and changes only when the design changes; cardinality counts rows and changes with every insert or delete. A quick test: an INSERT changes cardinality, never degree.

Keys in a Relational Database: Candidate, Primary, Alternate and Foreign

Keys are the heart of this chapter and the most tested topic in the board paper. They form a clear chain, and naming the exact key type is what earns the mark.

The key chain

  • Super key: any attribute set that is unique for every row.
  • Candidate key: a super key made minimal, so no attribute can be removed and still stay unique.
  • Primary key: the one candidate key chosen to identify rows. It must be unique and never NULL.
  • Alternate key: every candidate key not chosen as the primary key.
  • Foreign key: an attribute that refers to another table's primary key to link the two tables.
Quick Tip: When a question says "uniquely identify the tuples" but does not say "chosen", write candidate key, not primary key. Many students lose the Q 1(c) mark by jumping to "primary key" out of habit.

Composite keys and many-to-many tables

When one column alone cannot stay unique, a composite primary key made of two or more columns is used. In Question 11, one movie runs in many auditoriums, so Movie_ID repeats in AUDI and the primary key becomes (AudiNo, Movie_ID). In Question 12, the junction table PROJECT_ASSIGNED has two foreign keys, one to STUDENT and one to PROJECT.

NULL Values and Integrity Constraints

A NULL is a special marker that means "value unknown or not applicable". It is not zero and not a blank space. Two integrity rules decide where NULL is allowed, and pairing each rule with its key is an easy way to earn marks.

  • Entity integrity: the primary key must be unique and can never be NULL. This is why (NULL, Kabaddi) in Question 6 cannot exist.
  • Referential integrity: every non-NULL foreign key value must match a primary key in the parent table. A foreign key may be NULL, because the rule only checks values that are present.
  • NOT NULL: a column-level rule that forbids NULL, used to enforce a business rule like "every student must give a preference".
  • CHECK: a rule that values must satisfy a condition, such as Price > 0 in Question 10.
Remember: A primary key never accepts NULL, but a foreign key can. The one exception is a foreign key that is also part of a composite primary key, where entity integrity forbids NULL.

Common Mistakes Students Make in the Database Concepts Chapter

The repeat-offender mistakes in Database Concepts board answers:

  • Writing "primary key" for a candidate key: when the clue does not say "chosen", the general term is candidate key.
  • Confusing degree and cardinality: degree counts columns, cardinality counts rows. An INSERT changes only cardinality.
  • Claiming a foreign key cannot be NULL: it can, unless it is part of a primary key. Only the primary key has an absolute NULL ban.
  • Checking only one constraint: a tuple is rejected if it breaks any single rule, so scan primary key, NOT NULL, CHECK and foreign key in turn.
  • Treating row order as meaningful: a relation is a set, so re-sorting rows or swapping columns gives the same relation state.

How to Use the Database Concepts NCERT Solutions PDF for Board Prep

The Database Concepts chapter is theory-heavy but very scoring once the key chain and the two integrity rules are clear. The best approach is two passes: one for the vocabulary, one for applying the rules to the table-based questions.

First pass: vocabulary and rules (1 hour)

Read the chapter and write one line of meaning for each term: relation, tuple, attribute, degree, cardinality, and each key in the chain. Then write the two integrity rules and tie each to its key. This vocabulary alone answers Questions 1 and 3.

Second pass: apply the rules (1.5 to 2 hours)

Work Questions 6, 8, 10 and 12 on paper first, deciding for each row whether a constraint allows it. Then open these solutions and check your reasoning. Pay attention to which column is the key, because that one question decides most answers.

CUET and JEE angle

For students preparing competitive exams, database concepts appear in CUET Computer Science and in JEE-level computer-application papers. Key types, normalisation and integrity constraints are exactly the kind of definition and reasoning questions those papers reuse, so the work here doubles as competitive prep.

Previous Year Question Trends from the Database Concepts Chapter

The Database Concepts chapter is tested in CBSE board papers mainly through definition, differentiate and key-spotting questions, with a database-design question that carries the most marks. The table below maps the asked question types across recent board papers.

YearQuestion type askedMarks
2025Define candidate key and alternate key; identify the foreign key in a given table1 + 2
2024Differentiate primary key and foreign key; find degree and cardinality2 + 2
2023Why a foreign key may be NULL; check insert validity against constraints2 + 3
2022Limitations of a file system overcome by a DBMS3
2021Define metadata and data dictionary; identify the primary key of a relation1 + 1

Also Check: The full set of CBSE board paper questions for this chapter is included in the downloadable PDF above, updated for the 2026-27 cycle.

Other Resources for Class 12 Computer Science Chapter 8 Database Concepts

Pair this NCERT Solutions PDF with the matching revision notes, handwritten notes and the official NCERT book chapter. All resources for Class 12 Computer Science Chapter 8 Database Concepts are linked below.

ResourceWhat it coversOpen
NCERT SolutionsStep-by-step answers to all 13 exercise questions, with an Expert Solution for each.You are here
NotesConcept-first revision notes on the relational model, keys and integrity constraints.Class 12 Computer Science Chapter 8 Notes
Handwritten NotesScanned-style handwritten pages for last-minute board revision.Class 12 Computer Science Chapter 8 Handwritten Notes
NCERT Book PDFOfficial NCERT Computer Science Chapter 8 Database Concepts textbook in PDF form.Class 12 Computer Science Chapter 8 NCERT Book PDF

NCERT Solutions for Class 12 Computer Science: All Chapters

Related Links: Use the table below to open the NCERT Solutions for the other chapters of Class 12 Computer Science. Every chapter ships with the same step-by-step answer style, full PDF download, and revision FAQ.

All NCERT Solutions for Class 12 Computer Science Chapter 8 Database Concepts with Step-by-Step Solutions

Q 1

Give the terms for each of the following:
a) Collection of logically related records.
b) DBMS creates a file that contains description about the data stored in the database.
c) Attribute that can uniquely identify the tuples in a relation.
d) Special value that is stored when actual data value is unknown for an attribute.
e) An attribute which can uniquely identify tuples of the table but is not defined as primary key of the table.
f) Software that is used to create, manipulate and maintain a relational database.

Q 2

Why are foreign keys allowed to have NULL values? Explain with an example.

Q 3

Differentiate between:
a) Database state and database schema
b) Primary key and foreign key
c) Degree and cardinality of a relation

Q 4

Compared to a file system, how does a database management system avoid redundancy in data through a database?

Q 5

What are the limitations of a file system that can be overcome by a relational DBMS?

Q 6

A school requires each student to give only one sports preference. The class representative prepared this list. Answer the questions below.

Roll_noPreference
9Cricket
13Football
17Badminton
17Football
21Hockey
24NULL
NULLKabaddi

a) Can a NULL value be assigned to Roll no 24's preference field?
b) Roll no 17 has given two preferences. Which property of the relational DBMS is violated, and which constraint or key checks against it?
c) Kabaddi was not chosen by any student. Can this tuple exist in the relation?

Q 7

Two class representatives prepared two separate Sports Preferences tables for the same class.

Section 1 (sorted on Roll_no)

Roll_noSports
9Cricket
13Football
17Badminton
21Hockey
24Cricket

Section 2 (sorted on Sports, columns swapped)

SportsRoll_no
Badminton17
Cricket9
Cricket24
Football13
Hockey21

Are the states of both relations equivalent? Justify.

Q 8

The school canteen wants a database for items and bills. Design it by answering:

a) To store each item name with its price (each item only once), what relation should be used, with attribute names and data types? What restriction is needed?
b) To know the quantity purchased, should this be a new relation or part of the previous one? Identify a primary key and foreign key so that (i) the same bill cannot be generated for different orders and (ii) a bill can be generated only for available items.
c) The school wants total calories per order. In which relation should 'calories' be stored?

Q 9

An organisation creates a database EMP-DEPENDENT:
EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID)
DEPENDENT(EmployeeID, DependentName, Relationship)

a) Name the attributes of EMPLOYEE that can be candidate keys.
b) To retrieve a particular employee's dependents, name the tables and the key required.
c) What is the degree of EMPLOYEE and DEPENDENT?

Q 10

M/s Sheetal Pvt Ltd maintains a SCHOOL_UNIFORM database. Schema: UNIFORM(UCode PRIMARY KEY, UName NOT NULL, UColor) and COST(UCode, Size [composite PK], Price > 0). UNIFORM already has UCodes 1 to 6, and COST has rows for them.

a) Can these tuples be inserted into UNIFORM? Give reasons.
  i) 7, Handkerchief, NULL   ii) 4, Ribbon, Red   iii) 8, NULL, White
b) Can these tuples be inserted into COST? Give reasons.
  i) 7, S, 0   ii) 9, XL, 100

Q 11

In a multiplex, one movie can be shown in more than one auditorium. Two relations are kept:
Movie(Movie_ID, MovieName, ReleaseDate)
Audi(AudiNo, Movie_ID, Seats, ScreenType, TicketPrice)

a) Is it correct to make Movie_ID the primary key of MOVIE? If not, suggest one.
b) Is it correct to make AudiNo the primary key of AUDI? If not, suggest one.
c) Is there any foreign key in either relation?

Q 12

For the Student Project Database, answer the questions below.

STUDENT

Roll NoNameClassSectionRegistration_ID
11MohanXI1IP-101-15
12SohanXI2IP-104-15
21JohnXII1CS-103-14
22MeenaXII2CS-101-14
23JuhiXII2CS-101-10

PROJECT_ASSIGNED

Registration_IDProjectNo
IP-101-15101
IP-104-15103
CS-103-14102
CS-101-14105
CS-101-10104

(PROJECT has ProjectNo and PName.) a) Name the primary key of each table.
b) Find the foreign key(s) in PROJECT_ASSIGNED.
c) Is there any alternate key in STUDENT? Justify.
d) Can a user assign a duplicate value to Roll No in STUDENT? Justify.

Q 13

For the same Student Project Database, can we perform the following?
a) Insert a student record with a missing roll number.
b) Insert a student record with a missing registration number.
c) Insert a project detail without a submission date.
d) Insert a record with Registration_ID IP-101-19 and ProjectNo 206 in PROJECT_ASSIGNED.

NCERT Solutions Class 12 Computer Science Chapter 8 Database Concepts FAQs

Ques. How many questions are there in NCERT Class 12 Computer Science Chapter 8 Database Concepts?

Ans. There are 13 end-of-chapter exercise questions in NCERT Class 12 Computer Science Chapter 8 Database Concepts. All 13 are solved with full answers and an Expert Solution. The mix is one "give the term" block, several differentiate and reasoning questions, one canteen database design question, and a set of key-spotting and insert-validity questions on given tables.

Ques. What is the difference between a candidate key, a primary key and an alternate key?

Ans. A candidate key is any minimal attribute set whose values are unique for every tuple, so it can identify a row on its own. A relation can have several candidate keys. One of them is chosen as the primary key, which must be unique and can never be NULL. Every candidate key that is not chosen as the primary key becomes an alternate key. For example, in a STUDENT table both Roll No and Registration_ID are candidate keys; if Roll No is chosen as primary, then Registration_ID is the alternate key.

Ques. Why is a foreign key allowed to have a NULL value?

Ans. A foreign key follows referential integrity, which says only that any value present in the foreign key column must already exist as a primary key in the parent table. NULL is the absence of a value, so the rule does not test it, which means a foreign key is allowed to be NULL. A NULL foreign key simply means "this row is not linked to any parent yet", such as an employee not yet assigned a department. The one exception is when the foreign key is also part of a primary key, because entity integrity then forbids NULL.

Ques. What is the difference between degree and cardinality of a relation?

Ans. Degree is the number of attributes (columns) in a relation, while cardinality is the number of tuples (rows). Degree is fixed by the table design and changes only when a column is added or dropped, whereas cardinality changes every time a row is inserted or deleted. A quick test is that an INSERT changes the cardinality but never the degree. For example, a table with 5 columns and 10 rows has degree 5 and cardinality 10.

Ques. How does a relational DBMS remove data redundancy compared to a file system?

Ans. A file system stores data in separate, application-owned files, so the same fact like a student's name and address is copied into many files. A relational DBMS stores all data once in a central shared database and uses normalisation to split data into related tables linked by keys. Other tables store only a small key, such as Roll_no, and refer back to the one place the full details live. Because each fact is stored only once, less storage is used and an update made once is seen everywhere, which also removes data inconsistency.

Ques. How many pages is the Class 12 Computer Science Database Concepts NCERT Solutions PDF?

Ans. The Database Concepts NCERT Solutions PDF runs about 22 pages and covers all 13 exercise questions with step-by-step reasoning, schema tables, labelled key diagrams, and an Expert Solution for each question. Both Normal and HD versions are available from this page, and both are free to download for the 2026-27 session.

Ques. Is the NCERT Solutions for Class 12 Computer Science Chapter 8 aligned with the 2026-27 syllabus?

Ans. Yes. This page reflects the current 2026-27 CBSE syllabus for Class 12 Computer Science. The Database Concepts chapter is unchanged for the current cycle, and every answer follows the NCERT textbook, covering the relational model, the key chain and the integrity constraints. The solutions are useful for the CBSE board exam, and the same database ideas help with CUET Computer Science and JEE-level computer-application questions.

Ques. What does a NULL value mean in a database?

Ans. A NULL is a special marker that means the value is unknown or not applicable. It is not the same as zero and not the same as a blank space or empty string. NULL is allowed in any non-key attribute, and it is also allowed in a stand-alone foreign key to mean "no related row yet". It is never allowed in a primary key, because entity integrity requires the primary key to identify every row, and a row with no identity cannot exist.