Skip to main content
Chapter 8 of 13
NCERT Solutions

Database Concepts

CBSE · Class 12 · Computer Science

NCERT Solutions for Database Concepts — CBSE Class 12 Computer Science.

43 questions84 flashcards5 concepts

Interactive on Super Tutor

Studying Database Concepts? Get the full interactive chapter.

Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for ncert solutions and more.

1,000+ Class 12 students started this chapter today

An infographic illustrating the common problems associated with manual record keeping, such as data inconsistency, loss of data, tedious entry, and erroneous calculations, using a school attendance re
Super Tutor

Learn better with visuals Super Tutor has hundreds of illustrations like this across every chapter — all free to try.

Get started
35 Questions Solved · 1 Section

18 worked solutions below. Unlock all 35 free in Super Tutor

EXERCISE

1Give the terms for each of the following:Show solution
a) A database is a collection of logically related records.

b) The file that contains description about the data stored in the database is called meta-data or data dictionary.

c) An attribute that can uniquely identify tuples in a relation is a candidate key.

d) The special value stored when actual data is unknown is NULL.

e) An attribute that can uniquely identify tuples but is not chosen as the primary key is an alternate key.

f) The software used to create, manipulate, and maintain a relational database is a DBMS.

Not sure why a step works? check your working in Super Tutor

2Why foreign keys are allowed to have NULL values? Explain with an example.Show solution
A foreign key is allowed to have NULL value when the referencing attribute is not a part of the primary key of that table. This is because the relation may not always have a matching record in the referenced table.

For example, in the STUDENT table, GUID is a foreign key referring to GUARDIAN(GUID). If a student’s guardian details are not available, then GUID can be NULL. The chapter also states that a foreign key can take NULL value if it is not part of the primary key of the foreign table.

Not sure why a step works? check your working in Super Tutor

3Differentiate between:Show solution
### a) Database state and database schema
- Database schema is the design or skeleton of the database. It describes table names, columns, data types, constraints, and relationships.
- Database state or database instance is the snapshot of the database at a given time after data is loaded.

### b) Primary key and foreign key
- A primary key uniquely identifies tuples within the same relation.
- A foreign key is an attribute whose value is derived from the primary key of another relation and is used to relate two tables.

### c) Degree and cardinality of a relation
- Degree = number of attributes in a relation.
- Cardinality = number of tuples/rows in a relation.

Not sure why a step works? check your working in Super Tutor

4Compared to a file system, how does a database management system avoid redundancy in data through a database?Show solution
A DBMS avoids redundancy by storing related data in related tables and using common fields to connect them.

In the school example, instead of repeating the student name and guardian details in the attendance file, the database keeps:
- STUDENT table for student details
- GUARDIAN table for guardian details
- ATTENDANCE table for attendance records

The RollNumber links ATTENDANCE with STUDENT, and GUID links STUDENT with GUARDIAN. Also, guardian details are stored only once in the GUARDIAN table, so the same guardian information is not repeated for siblings. This reduces redundancy and helps avoid inconsistency.

Not sure why a step works? check your working in Super Tutor

5What are the limitations of file system that can be overcome by a relational DBMS?Show solution
The limitations of a file system that can be overcome by a relational DBMS are:

- Difficulty in access
- Data redundancy
- Data inconsistency
- Data isolation
- Data dependence
- Controlled data sharing

A relational DBMS helps manage related data efficiently, supports linking between tables, and allows controlled access through keys and queries.

Not sure why a step works? check your working in Super Tutor

6A school has a rule that each student must participate in a sports activity. So each one should give only one preference for sports activity. Suppose there are five students in a class, each having a unique roll number. The class representative has prepared a list of sports preferences as shown below. Answer the following:Show solution
The table shown is a relation of sports preferences. The important idea is that each student should give only one preference and the relation must not contain duplicate or invalid tuples. The answers to the subparts are based on relation properties, NULL values, and keys.

Not sure why a step works? check your working in Super Tutor

6aRoll no 24 may not be interested in sports. Can a NULL value be assigned to that student's preference field?Show solution
Yes. NULL may be assigned because the student may not be interested in sports, so the preference is unknown/not applicable. The chapter states that NULL is used to represent values that are unknown or non-applicable to certain attributes.

Not sure why a step works? check your working in Super Tutor

6bRoll no 17 has given two preferences in sports. Which property of relational DBMC is violated here? Can we use any constraint or key in the relational DBMS to check against such violation, if any?Show solution
The property of a relation violated is that each tuple must be distinct and each attribute should have a single atomic value. Here, roll number 17 has given two preferences, so one student appears in more than one tuple, which breaks the idea that one tuple should represent one distinct record.

Yes, we can use a constraint/key to check this. Since the school rule says each student should give only one preference, we can make Roll_no a primary key or at least place a UNIQUE constraint on it so that the same roll number cannot appear twice in the relation.

Not sure why a step works? check your working in Super Tutor

6cKabaddi was not chosen by any student. Is it possible to have this tuple in the Sports Preferences relation?Show solution
Yes, it is possible. A tuple can exist even if no student chose that sport, because the relation can contain data that are not referenced by another relation. The chapter does not forbid such a tuple. Since the relation is about sports preferences, Kabaddi with a roll number value can still be stored as a record, provided it follows the relation’s rules.

Not sure why a step works? check your working in Super Tutor

7In another class having 2 sections, the two respective class representatives have prepared 2 separate Sports Preferences tables, as shown below:Show solution
The two tables are not equivalent as states, even though they contain the same information.

Reason:
- The sequence of attributes is different in the two relations, and according to the chapter, attribute order is immaterial.
- The sequence of tuples is also immaterial.
- However, to be equivalent as relation states, they must represent the same set of tuples with the same attributes and values.

Here, both tables contain the same roll numbers and sports values, just arranged differently. So as relations, they represent the same information and are equivalent.

Not sure why a step works? check your working in Super Tutor

8The school canteen wants to maintain records of items available in the school canteen and generate bills when students purchase any item from the canteen. The school wants to create a canteen database to keep track of items in the canteen and the items purchased by students. Design a database by answering the following questions:Show solution
For a canteen database, we need to store item details and purchase details separately so that each item is stored once and purchases can be recorded repeatedly.

A suitable design is:
- ITEM relation for item name, price, and calories
- BILL/ORDER relation for purchase details such as item bought and quantity

This separation avoids redundancy and allows billing for multiple orders.

Not sure why a step works? check your working in Super Tutor

8aTo store each item name along with its price, what relation should be used? Decide appropriate attribute names along with their data type. Each item and its price should be stored only once. What restriction should be used while defining the relation?Show solution
To store each item name with its price, use a relation such as ITEM(ItemID, ItemName, Price).

A suitable choice of attributes is:
- ItemID: integer, unique identifier
- ItemName: string/text
- Price: numeric/decimal

Since each item and its price should be stored only once, the ItemID should be defined as the primary key or at least UNIQUE, so duplicate item records are not inserted.

Not sure why a step works? check your working in Super Tutor

8bIn order to generate bill, we should know the quantity of an item purchased. Should this information be in a new relation or a part of the previous relation? If a new relation is required, decide appropriate name and data type for attributes. Also, identify appropriate primary key and foreign key so that the following two restrictions are satisfied:Show solution
The quantity of an item purchased should be kept in a new relation, because it belongs to the billing/purchase transaction, not to the item master list.

A suitable relation can be BILL or ORDER with attributes like:
- BillNo / OrderNo: integer
- ItemID: integer
- Quantity: integer
- optionally Date: date

To satisfy the restrictions:
1. The same bill cannot be generated for different orders → use BillNo/OrderNo as the primary key.
2. Bill can be generated only for available items → make ItemID a foreign key referencing ITEM(ItemID).

This way only valid items can appear in billing records.

Not sure why a step works? check your working in Super Tutor

8cThe school wants to find out how many calories students intake when they order an item. In which relation should the attribute 'calories' be stored?Show solution
The attribute calories should be stored in the ITEM relation, because calories are a property of the item itself, not of the individual purchase. So the item master table should include it along with item name and price.

Not sure why a step works? check your working in Super Tutor

9An organisation wants to create a database EMP-DEPENDENT to maintain following details about its employees and their dependent.Show solution
For the EMP-DEPENDENT database, the given relations are:
- EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID)
- DEPENDENT(EmployeeID, DependentName, Relationship)

These relations can be used to store employee details and dependent details. The key idea is that EmployeeID links the dependent to the correct employee.

Not sure why a step works? check your working in Super Tutor

9aName the attributes of EMPLOYEE, which can be used as candidate keys.Show solution
The candidate keys are the attributes that can uniquely identify an employee. In the given relation EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID), the attributes that can be used as candidate keys are AadharNumber and EmployeeID, because both can uniquely identify tuples.

Not sure why a step works? check your working in Super Tutor

9bThe company wants to retrieve details of dependent of a particular employee. Name the tables and the key which are required to retrieve this detail.Show solution
To retrieve details of a dependent of a particular employee, we need the tables:
- EMPLOYEE
- DEPENDENT

The required key is EmployeeID, because it is the common link between the two tables and is the primary key in EMPLOYEE and a foreign key in DEPENDENT.

Not sure why a step works? check your working in Super Tutor

9cWhat is the degree of EMPLOYEE and DEPENDENT relation?Show solution
The degree of a relation is the number of attributes.

- EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID) has 5 attributes, so its degree is 5.
- DEPENDENT(EmployeeID, DependentName, Relationship) has 3 attributes, so its degree is 3.

Not sure why a step works? check your working in Super Tutor

10School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL_UNIFORM Database with two relations viz. UNIFORM and COST. The following figure shows database schema and its state.
10aCan they insert the following tuples to the UNIFORM Relation? Give reasons in support of your answer.
10bCan they insert the following tuples to the COST Relation? Give reasons in support of your answer.
11In a multiplex, movies are screened in different auditoriums. One movie can be shown in more than one auditorium. In order to maintain the record of movies, the multiplex maintains a relational database consisting of two relations viz. MOVIE and AUDI respectively as shown below:
11aIs it correct to assign Movie_ID as the primary key in the MOVIE relation? If no, then suggest an appropriate primary key.
11bIs it correct to assign AudiNo as the primary key in the AUDI relation? If no, then suggest appropriate primary key.
11cIs there any foreign key in any of these relations?
12For the above given database STUDENT-PROJECT, answer the following:
12aName primary key of each table.
12bFind foreign key(s) in table PROJECT-ASSIGNED.
12cIs there any alternate key in table STUDENT? Give justification for your answer.
12dCan a user assign duplicate value to the field RollNo of STUDENT table? Jusify.
13For the above given database STUDENT-PROJECT, can we perform the following operations?
13aInsert a student record with missing roll number value.
13bInsert a student record with missing registration number value.
13cInsert a project detail without submission-date.
13dInsert a record with registration ID IP-101-19 and ProjectNo 206 in table PROJECT-ASSIGNED.

17 more solved questions in Database Concepts

Every remaining exercise is solved step by step in Super Tutor, plus practice quizzes and flashcards for this chapter. Free to start.

Stuck on a step?

Ask Super Tutor AI to explain any solution on this page in a simpler way — free, 24x7.

Ask a Doubt Free

Frequently Asked Questions

What are the important topics in Database Concepts for CBSE Class 12 Computer Science?
Database Concepts covers several key topics that are frequently asked in CBSE Class 12 board exams. Focus on the core concepts listed on this page and practise related questions to build confidence.
How to score full marks in Database Concepts — CBSE Class 12 Computer Science?
Understand the core concepts first, then work through the 43 practice questions available for this chapter. Revise formulas and definitions regularly, and use flashcards for quick recall before the exam.
Where can I get free NCERT Solutions for Database Concepts Class 12 Computer Science?
This page has free step-by-step NCERT Solutions for every exercise question in Database Concepts (CBSE Class 12 Computer Science) — written the way examiners award marks: given, formula, working, answer.

Sources & Official References

Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.

For serious students

Get the full Database Concepts chapter — for free.

Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 12 Computer Science.