Database Concepts — NCERT Solutions
CBSE · Class 12 · Computer Science
NCERT Solutions for Database Concepts, CBSE Class 12 Computer Science: 34 textbook questions solved step by step. Covers Exercise.
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.
Free trial, no card needed.

Learn better with visuals Super Tutor pairs illustrations like this with notes and quizzes for Database Concepts.
Get startedThe first 17 solutions are open to read. The other 17 are free with a Super Tutor account. Unlock all 34 free in Super Tutor
Exercise
1Give 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.
Show solution
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.
a) Database — a collection of logically related records.
b) Meta-data — the file/description of the data stored in the database.
c) Primary key — the attribute that can uniquely identify tuples in a relation.
d) NULL — the special value used when actual data is unknown.
e) Alternate key — an attribute that can uniquely identify tuples but is not chosen as the primary key.
f) DBMS — software used to create, manipulate, and maintain a relational database.
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:a) Database state and database schema
b) Primary key and foreign key
c) Degree and cardinality of a relation
Show solution
a) Database state and database schema
b) Primary key and foreign key
c) Degree and cardinality of a relation
a) Database state and database schema
- Database schema is the design of the database. It describes the structure, table names, columns, constraints, and relationships.
- Database state (or instance) is the snapshot of data present in the database at a particular time.
b) Primary key and foreign key
- Primary key uniquely identifies each tuple within its own relation.
- Foreign key is an attribute in one relation that refers to the primary key of another relation and is used to create a relationship between tables.
c) Degree and cardinality of a relation
- Degree = number of attributes/columns 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:Table: Sports Preferences
Roll_no Preference 9 Cricket 13 Football 17 Badminton 17 Football 21 Hockey 24 NULL NULL Kabaddi
Show solution
Table: Sports Preferences
| Roll_no | Preference |
|---|---|
| 9 | Cricket |
| 13 | Football |
| 17 | Badminton |
| 17 | Football |
| 21 | Hockey |
| 24 | NULL |
| NULL | Kabaddi |
a) No.
Because Preference is the attribute where one student gives one sports choice. A value NULL would mean the preference is unknown or not given, which goes against the rule that each student must give only one preference.
b) Property 3 of relational model is violated, because an attribute must not have many values in one tuple. Here roll no. 17 appears twice with two different preferences.
Yes, we can use a constraint to prevent such violation, for example by making Roll_no unique and ensuring only one tuple per student is allowed.
c) No.
The tuple with NULL roll number should not be accepted if Roll_no is meant to identify a student, because a relation should have distinct tuples and the identifying attribute should not be NULL.
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:Sports preference of section 1 (arranged on roll number column)
Table: Sports Preferences
Roll_no Sports 9 Cricket 13 Football 17 Badminton 21 Hockey 24 Cricket
Sports preference of section 2 (arranged on Sports name column, and column order is also different)
Table: Sports Preferences
Sports Roll_no Badminton 17 Cricket 9 Cricket 24 Football 13 Hockey 21
Show solution
Sports preference of section 1 (arranged on roll number column)
Table: Sports Preferences
| Roll_no | Sports |
|---|---|
| 9 | Cricket |
| 13 | Football |
| 17 | Badminton |
| 21 | Hockey |
| 24 | Cricket |
Sports preference of section 2 (arranged on Sports name column, and column order is also different)
Table: Sports Preferences
| Sports | Roll_no |
|---|---|
| Badminton | 17 |
| Cricket | 9 |
| Cricket | 24 |
| Football | 13 |
| Hockey | 21 |
Yes, the states of both relations are equivalent.
- They contain the same set of tuples:
- (9, Cricket)
- (13, Football)
- (17, Badminton)
- (21, Hockey)
- (24, Cricket)
- The order of rows is different, but in a relation, sequence of tuples is immaterial.
- The order of columns is also different, but sequence of attributes is also immaterial.
So both tables represent the same relation state.
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:i) The same bill cannot be generated for different orders.
ii) Bill can be generated only for available items in the canteen.
Show solution
i) The same bill cannot be generated for different orders.
ii) Bill can be generated only for available items in the canteen.
The quantity should be stored in a new relation, not in the item relation, because it belongs to a particular purchase/bill, not to the item itself.
A suitable design is:
- ITEM(ItemCode, ItemName, Price, Calories) or ITEM(ItemCode, ItemName, Price)
- BILLDETAILS(BillNo, ItemCode, Quantity)
To satisfy the given restrictions:
- The same bill cannot be generated for different orders
- Use BillNo as the primary key of the bill relation, or use a composite key if needed with order identification.
- Bill can be generated only for available items in the canteen
- Make ItemCode in BILLDETAILS a foreign key that refers to the primary key of the ITEM relation.
So, quantity should be in a separate relation and linked through a foreign key to the item table.
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.EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID)
DEPENDENT(EmployeeID, DependentName, Relationship)
Show solution
EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID)
DEPENDENT(EmployeeID, DependentName, Relationship)
a) The attributes of EMPLOYEE that can be used as candidate keys are:
- AadharNumber
- EmployeeID
Both can uniquely identify an employee.
b) To retrieve dependent details of a particular employee, we need the tables:
- EMPLOYEE
- DEPENDENT
The required key is EmployeeID, which is the key used to relate the two tables. In DEPENDENT, EmployeeID acts as a foreign key referencing EMPLOYEE.
c) Degree means number of attributes.
- EMPLOYEE(AadharNumber, Name, Address, Department, EmployeeID) has 5 attributes, so degree = 5.
- DEPENDENT(EmployeeID, DependentName, Relationship) has 3 attributes, so degree = 3.
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
School Uniform Database
Attributes and Constraints
Table: UNIFORM
| Attribute | UCode | UName | UColor |
|---|---|---|---|
| Constraints | Primary Key | Not Null | - |
Table: COST
| Attribute | UCode | Size | Price |
|---|---|---|---|
| Constraints | Composite Primary Key | >0 |
Table: UNIFORM
| UCode | UName | UColor |
|---|---|---|
| 1 | Shirt | White |
| 2 | Pant | Grey |
| 3 | Skirt | Grey |
| 4 | Tie | Blue |
| 5 | Socks | Blue |
| 6 | Belt | Blue |
Table: COST
| UCode | Size | COST Price |
|---|---|---|
| 1 | M | 500 |
| 1 | L | 580 |
| 1 | XL | 620 |
| 2 | M | 810 |
| 2 | L | 890 |
| 2 | XL | 940 |
| 3 | M | 770 |
| 3 | L | 830 |
| 3 | XL | 910 |
| 4 | S | 150 |
| 4 | L | 170 |
| 5 | S | 180 |
| 5 | L | 210 |
| 6 | M | 110 |
| 6 | L | 140 |
| 6 | XL | 160 |
Free with a Super Tutor account
i) 7, Handkerchief, NULL
ii) 4, Ribbon, Red
iii) 8, NULL, White
Free with a Super Tutor account
i) 7, S, 0
ii) 9, XL, 100
Free with a Super Tutor account
Movie(Movie_ID, MovieName, ReleaseDate)
Audi(AudiNo, Movie_ID, Seats, ScreenType, TicketPrice)
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Student Project Database
Table: STUDENT
| Roll No | Name | Class | Section | Registration_ID |
|---|---|---|---|---|
| 11 | Mohan | XI | 1 | IP-101-15 |
| 12 | Sohan | XI | 2 | IP-104-15 |
| 21 | John | XII | 1 | CS-103-14 |
| 22 | Meena | XII | 2 | CS-101-14 |
| 23 | Juhi | XII | 2 | CS-101-10 |
Table: PROJECT
| ProjectNo | PName | SubmissionDate |
|---|---|---|
| 101 | Airline Database | 12/01/2018 |
| 102 | Library Database | 12/01/2018 |
| 103 | Employee Database | 15/01/2018 |
| 104 | Student Database | 12/01/2018 |
| 105 | Inventory Database | 15/01/2018 |
| 106 | Railway Database | 15/01/2018 |
Table: PROJECT ASSIGNED
| Registration_ID | ProjectNo |
|---|---|
| IP-101-15 | 101 |
| IP-104-15 | 103 |
| CS-103-14 | 102 |
| CS-101-14 | 105 |
| CS-101-10 | 104 |
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
Free with a Super Tutor account
17 more solved questions in Database Concepts
They are free with a Super Tutor account, along with practice quizzes and flashcards for this chapter. Free to start, no card needed.
Frequently Asked Questions
What are the important topics in Database Concepts for CBSE Class 12 Computer Science?
Are these NCERT Solutions for Database Concepts free?
How should I revise Database Concepts for the CBSE Class 12 board exam?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Database Concepts
Practice Quiz
Test yourself with a quick quiz
Important Questions
Exam-style questions with answers
Revision Notes
Key points for last-minute revision
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect
Study Plan
Step-by-step plan for this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
For serious students
Get the full Database Concepts chapter — start free.
Quizzes, flashcards, an AI doubt solver and a study plan for CBSE Class 12 Computer Science. Free to start, no card needed.