Skip to content
← Computer Science

Computer Science · Class 12 Optional

Ch 8Database Concepts — Class 12 Computer Science, concept-first.

Data is everywhere, and as we saw in the previous chapter, it is incredibly valuable. But value comes from being able to use data — and that starts with storing and managing it properly. Without a good system, data becomes a burden rather than an asset.

29

Q&A

11

Concepts

20m

Section weightage

Database Management · across all 2 lessons

Start learning — read this chapter →

Key concepts

Hover a concept to preview it and jump to its most relevant Q&A.

Manual Record Limitations

Think about keeping a diary by hand. You write in it every day, but over time the pages get smudged, your handwriting becomes harder to read, and if you lose the diary, all that effort is gone.

Start with this concept →

Chapter contents

The NCERT structure, section by section. Open a section to see its questions, then read the concept-first solution.

8.1

Introduction

Data is everywhere, and as we saw in the previous chapter, it is incredibly valuable. But value comes from being able to use data — and that starts with storing and managing it properly.

8.2

File System

A file is simply a container that stores data on a computer's storage device. The data inside a file can be anything — text, a computer program, comma separated values (CSV), pictures, audio, video, o…

8.2.1

Limitations of a File System

A file system works well when you have a few small files. But as the number of files grows and the volume of data increases, the file system becomes very difficult to manage.

8.3

Database Management System

A file system stores data in separate, unrelated files. This creates several problems: data redundancy (the same data repeated in many files), data inconsistency (conflicting copies of the same data),…

8.3.1

File System to DBMS

The shift from a file system to a DBMS is best understood by working through a concrete example. The textbook uses the school scenario where two separate files existed: a STUDENT file (maintained by t…

8.3.2

Key Concepts in DBMS

A Database Management System is not just a place to dump data. It is a carefully structured environment.

8.4

Relational Data Model

A data model is the blueprint for a database — it defines how data is structured, how it relates to other data, and what rules (constraints) govern it.

8.4.1

Three Important Properties of a Relation

A relation in the relational data model is not just any ordinary table or data file. It follows three specific properties that give it a formal, mathematical structure.

8.5

Keys in a Relational Database

A relation (table) must have distinct tuples — no two rows can be identical across all attributes. That means there should be at least one attribute (or combination of attributes) whose values are alw…

8.5.1

Candidate Key

A candidate key is an attribute (or a set of attributes) that can uniquely identify every row (tuple) in a relation.

8.5.2

Primary Key

A primary key is the single candidate key that the database designer selects to serve as the unique identifier for every row in a relation.

8.5.3

Composite Primary Key

Sometimes, no single column in a table can guarantee that every row will be unique. When that happens, you cannot pick just one attribute as the primary key.

8.5.4

Foreign Key

A foreign key is the mechanism that represents relationships between two tables in a relational database.

Summary

- A file in a file system is a container to store data in a computer. - A file system suffers from Data Redundancy, Data Inconsistency, Data Isolation, Data Dependence, and Controlled Data Sharing.

Exercises

+Show 13 questions13 questions
  1. Q1Give the terms for each of the following: (a) Collection of logically related records. (b) DBMS creates a file that contains description abo…Free
  2. Q2Why foreign keys are allowed to have NULL values? Explain with an example.Free
  3. Q3Differentiate between: (a) Database state and database schema (b) Primary key and foreign key (c) Degree and cardinality of a relationFree
  4. Q4Compared to a file system, how does a database management system avoid redundancy in data through a database?Preview
  5. Q5What are the limitations of file system that can be overcome by a relational DBMS?Preview
  6. Q6A school has a rule that each student must participate in a sports activity. So each one should give only one preference for sports activity…Preview
  7. Q7In another class having 2 sections, the two respective class representatives have prepared 2 separate Sports Preferences tables, as shown be…Preview
  8. Q8The school canteen wants to maintain records of items available in the school canteen and generate bills when students purchase any item fro…Preview
  9. Q9An organisation wants to create a database EMP-DEPENDENT to maintain following details about its employees and their dependent. EMPLOYEE(Aad…Preview
  10. Q10School uniform is available at M/s Sheetal Private Limited. They have maintained SCHOOL_UNIFORM Database with two relations viz. UNIFORM and…Preview
  11. Q11In a multiplex, movies are screened in different auditoriums. One movie can be shown in more than one auditorium. In order to maintain the r…Preview
  12. Q12For the above given database STUDENT-PROJECT, answer the following: Student Project Database Table: PROJECT | ProjectNo | PName | Submission…Preview
  13. Q13For the above given database STUDENT-PROJECT, can we perform the following operations? Table: PROJECT | ProjectNo | PName | SubmissionDate |…Preview

CBSE Sample Papers

Questions from official CBSE sample papers.

+Show 15 questions15 questions
  1. Q1State True or False : If table A has 6 rows and 3 columns, and table B has 5 rows and 2 columns, the Cartesian product of A and B will have…Preview
  2. Q2Assertion (A) : We can retrieve records from more than one table in MYSQL. Reason (R) : Foreign key is used to establish a relationship betw…Preview
  3. Q3Nisha is assigned the task of maintaining the staff data of an organization. She has to store the details of the staff in the SQL table name…Preview
  4. Q4A table, named THEATRE, in CINEMA database, has the following structure : Fields Type Th_ID char(5) Name varchar(15) City varchar(15) Locati…Preview
  5. Q5A relation in MySQL database consists of 2 tuples and 3 attributes. If 2 attributes are deleted and 4 tuples are added, what will be the car…Preview
  6. Q6Peter has created a table named Account in MySQL database, SCHOOL, having following structure : Stud_id – integer Sname – string Class – str…Preview
  7. Q7(A) (i) Define cartesian product with respect to RDBMS. (ii) Sunil wants to write a program in Python to update the quantity to 20 of the re…Preview
  8. Q8Differentiate between the terms Attribute and Domain in the context of Relational Data Model.Preview
  9. Q9Consider the following SQL table MEMBER in a SQL Database CLUB: Table: MEMBER M_ID NAME ACTIVITY M1001 Amina GYM M1002 Pratik GYM M1003 Simo…Preview
  10. Q10Fetchall() method fetches all rows in a result set and returns a: (a) Tuple of lists (b) List of tuples (c) List of strings (d) Tuple of str…Preview
  11. Q11(a) Consider the following tables - LOAN and BORROWER: Table: LOAN LOAN_NO B_NAME AMOUNT L-170 DELHI 3000 L-230 KANPUR 4000 Table: BORROWER…Preview
  12. Q12The school has asked their estate manager Mr. Rahul to maintain the data of all the labs in a table LAB. Rahul has created a table and enter…Preview
  13. Q13fetchone() method fetches only one row in a ResultSet and returns a __________. (a) Tuple (b) List (c) Dictionary (d) StringPreview
  14. Q14(a) (i) What possible output(s) are expected to be displayed on screen at the time of execution of the following code ? import random S=["Pe…Preview
  15. Q15The ABC Company is considering to maintain their salespersons records using SQL to store data. As a database administrator, Alia created the…Preview