Educational Galaxy shield logo

Educational Galaxy

LEARN • THINK • SPEAK • GROW

Chapter 7: Database Concepts

Original notes — ready CBSE (NCERT, English Medium) • Class 11 • Computer Science • Book: Informatics Practices

Print lets you save as PDF from the browser. This is not a textbook PDF.

Chapter 7: Database Concepts — EG's own notes, in simple words

Book: Informatics Practices (CBSE, Class 11)  |  Chapter 7  |  Medium: English

Labelled diagram for Chapter 7: Database Concepts

Diagram (labels on the image): Diagram (labels on the image): two tables linked by a key — the picture uses everyday tables as a visual stand-in for database tables.

Illustration for Chapter 7: Database Concepts

One key links two tables: the idea behind every relational database.

1. 1. Why databases exist

A school with hundreds of students cannot manage records in scattered files: names change, marks update, and the same student appears in many lists. A database is an organised collection of related data, managed by a database management system (DBMS) that stores, retrieves and protects it.

The DBMS advantage: data is stored once (less duplication), many users can use it safely, access can be controlled, and backup and recovery protect against loss.

2. 2. Tables, records and fields

A relational database stores data in tables. A table has rows and columns: each row is a record (one student), each column is a field or attribute (name, class, marks). A field holds one kind of data, such as text or numbers.

Original example: a Students table might have fields RollNo, Name, Class and Marks. One row — (12, “Asha”, “XI”, 88) — is one student's complete record.

3. 3. Keys: identifying records

A primary key is a field (or combination) that uniquely identifies each record and cannot be empty or repeated: RollNo works as a primary key if every student has a unique roll number. A foreign key is a field in one table that refers to the primary key of another table, linking them: a Marks table can carry RollNo as a foreign key pointing to the Students table.

A candidate key is any field that could serve as primary key; the chosen one is the primary key, and the rest are alternate keys.

4. 4. DBMS versus files, and data integrity

In a file system, each program keeps its own copy of data, so the same fact can disagree across files (data redundancy and inconsistency). A DBMS stores shared data once and controls access through it, keeping data consistent.

Integrity rules protect correctness: a primary key cannot be empty, a foreign key must point to an existing record, and field types must be respected (a marks field cannot hold text).

At a glance — chart / table

TermMeaningOriginal example
Table (relation)Data stored as rows and columnsStudents table
Record (tuple)One row: one complete itemOne student's row
Field (attribute)One column: one kind of dataName column
Primary keyUniquely identifies each recordRollNo
Foreign keyRefers to another table's primary keyRollNo in Marks table

Key Terms / Important Terms

  • Database — An organised collection of related data.
  • DBMS — Software managing a database: storage, retrieval, protection.
  • Table — Data stored as rows and columns.
  • Record — One row of a table; one complete item.
  • Field — One column of a table; one attribute.
  • Primary key — A field uniquely identifying each record; never empty or repeated.
  • Foreign key — A field referring to another table's primary key.
  • Data redundancy — The same data needlessly stored in multiple places.

Remember

  • Table = rows (records) × columns (fields).
  • Primary key: unique, never empty; foreign key: points to another table's primary key.
  • DBMS beats files: less duplication, shared controlled access, backup and recovery.
  • Integrity: primary keys never empty, foreign keys must point to real records.

Exam Tip / Common Mistake

Common mistake: choosing Name as a primary key. Names repeat and can change — a primary key must be unique and stable, which is why RollNo (or an ID) is the right choice.

Practice set — try it yourself

  1. Design a Students table: name four fields and choose a primary key with a reason. Hint: Hint: The key must be unique and stable for every student.
  2. A Marks table carries RollNo. Is RollNo a primary or foreign key there, and why? Hint: Hint: It points to the Students table's key.
  3. Give two problems of storing school data in separate files instead of a database. Hint: Hint: Duplication and disagreement between copies are two.
  4. What rule stops a foreign key pointing to a student who does not exist? Hint: Hint: It is an integrity rule about references.
  5. Why can Name not be a primary key in a large school? Hint: Hint: Two students can share a name.

Questions with Answers

  1. What is a database, and what does a DBMS do? Answer: Answer: A database is an organised collection of related data. A DBMS is the software that stores, retrieves, protects and manages that data for its users.
  2. Explain table, record and field with a school example. Answer: Answer: In a Students table, the table is the whole collection, a record is one row (one student's full details), and a field is one column (one attribute such as Name or Class).
  3. What is a primary key? Why is RollNo a better primary key than Name? Answer: Answer: A primary key uniquely identifies each record and is never empty or repeated. RollNo is better because every student has a unique, stable roll number, while names can repeat and change.
  4. What is a foreign key? Give an example. Answer: Answer: A foreign key is a field in one table that refers to the primary key of another table, linking them. In a Marks table, RollNo is a foreign key pointing to RollNo, the primary key of the Students table.
  5. Give two advantages of a DBMS over a file system. Answer: Answer: A DBMS stores shared data once, reducing redundancy and inconsistency, and it controls access with backup and recovery, so many users can work safely on the same data.