Class XII · Chapter 8Unit 3, Database Management (20 marks shared with SQL)8 min read
Share:WhatsAppLinkedIn

Chapter 8: Database Concepts

CBSE Unit: Unit 3, Database Management (20 marks shared with SQL) Marks Weightage: ~4-6 marks (theory foundation for SQL chapter) Priority: HIGH, foundational theory, direct questions in board exams


Key Concepts

8.1 File System, A file is a container to store data in a computer (text, CSV, programs, images, audio/video), Files can be accessed directly but require application programs to process data through software, Example: School stores student details in one file, attendance in another file

8.2 Limitations of File System

Limitation Explanation Example
Difficulty in Access No built-in mechanism to retrieve data; need custom programs Cannot easily generate reports without writing code
Data Redundancy Same data duplicated in different files Student name stored in both STUDENT and ATTENDANCE files
Data Inconsistency Same data in different files does not match Name spelling changed in one file but not another
Data Isolation No link/mapping between related files STUDENT and ATTENDANCE files maintained separately with no connection
Data Dependence Changing file structure requires changing all programs Adding a new field requires modifying every program that accesses the file
Controlled Data Sharing Difficult to enforce access control Cannot restrict a teacher to read-only access on attendance file

8.3 Database Management System (DBMS)

  • Database: A collection of logically related data organized in tables
  • DBMS: Software used to create and manage databases, Examples of DBMS: MySQL, Oracle, PostgreSQL, SQL Server, Microsoft Access, MongoDB, DBMS provides an abstract view of data and serves as an interface between database and end users/application programs
  • Querying: Retrieving data from a database through special commands

8.4 Key Concepts in DBMS

(A) Database Schema, The design/structure of a database (skeleton), Represents: table names, fields/columns, data types, constraints, relationships, Also called visual or logical architecture

(B) Data Constraint, Restrictions/limitations on the type of data that can be inserted, Example: Mobile number must be exactly 10 digits, non-negative, Constraints ensure accuracy and reliability of data

(C) Meta-data / Data Dictionary, Database schema + constraints stored in a database catalog

  • Meta-data = data about the data

(D) Database Instance, The snapshot/state of the database at any given time, Empty when schema is first defined; changes with insertions/updates/deletions, A schema can have many instances at different times

(E) Query, A request to a database for obtaining information, Can retrieve data from one table or combination of tables, Written using a query language (SQL)

(F) Data Manipulation

  • Insertion: Adding new records (e.g., new student joins)
  • Deletion: Removing records (e.g., student leaves school)
  • Update: Modifying existing records (e.g., guardian changes phone number)

(G) Database Engine, Underlying component/set of programs used by DBMS to create database and handle queries

8.5 Relational Data Model, Most commonly used data model, Tables are called relations

  • Each table has multiple columns (unique names) and rows, Each row represents a related set of values
  • Relations in a database are associated with each other through common attributes (linking attributes)

Key Terminology

Term Definition Example
Relation A table in the database GUARDIAN table
Attribute A column/field of a relation GUID, GName, GPhone, GAddress
Tuple A row/record of a relation One guardian's complete data
Domain Set of allowed values for an attribute (data type) RollNumber domain = set of integers
Degree Number of attributes (columns) in a relation GUARDIAN has degree 4
Cardinality Number of tuples (rows) in a relation GUARDIAN with 5 rows has cardinality 5

8.6 Three Important Properties of a Relation

Property 1 (Attributes):

  • Each attribute has a unique name
  • Sequence of attributes is immaterial (column order does not matter)

Property 2 (Tuples):

  • Each tuple must be distinct (no two identical rows), Sequence of tuples is immaterial (row order does not matter)

Property 3 (State/Values):

  • All values in an attribute must be from the same domain (same data type), Each value must be atomic (indivisible into meaningful subparts)
  • No multi-valued attributes (e.g., cannot have multiple phone numbers in one field)
  • NULL represents unknown or non-applicable values

8.7 Keys in a Relational Database

Candidate Key, Attribute(s) that take distinct values and can uniquely identify tuples, A relation can have one or more candidate keys, Example: In GUARDIAN, both GUID and GPhone are candidate keys

Primary Key, The candidate key chosen by the database designer to uniquely identify tuples, Only ONE primary key per table, Remaining candidate keys become Alternate Keys

  • Example: GUID chosen as primary key; GPhone becomes alternate key

Composite Primary Key, Primary key consisting of more than one attribute (when no single attribute can uniquely identify tuples), Example: In ATTENDANCE, {RollNumber, AttendanceDate} together form the composite primary key

Foreign Key, An attribute whose value is derived from the primary key of another relation

  • Used to represent the relationship between two relations, Can take NULL values (if not part of primary key of its own table), The table containing the foreign key = Referencing/Foreign Relation
  • The table whose primary key is referenced = Referenced/Primary/Master Relation
  • Example: GUID in STUDENT table is a foreign key referencing GUID in GUARDIAN table

Important Definitions

  1. Database: A collection of related tables (relations)
  2. DBMS: Software to create, manage, and manipulate databases
  3. Schema: The design/structure of a database
  4. Instance: The snapshot of a database at any given time
  5. Meta-data: Data about the data (schema + constraints stored in catalog)
  6. Query: A request to a database for information retrieval
  7. Relation: A table in a relational database
  8. Attribute: A column/field in a relation
  9. Tuple: A row/record in a relation
  10. Domain: Set of permissible values for an attribute
  11. Degree: Number of attributes in a relation
  12. Cardinality: Number of tuples in a relation
  13. Primary Key: Attribute that uniquely identifies each tuple
  14. Candidate Key: Any attribute that CAN uniquely identify tuples
  15. Alternate Key: Candidate key NOT chosen as primary key
  16. Composite Primary Key: Primary key made of more than one attribute
  17. Foreign Key: Attribute that references the primary key of another table
  18. Data Redundancy: Same data stored in multiple places
  19. Data Inconsistency: Same data in different places does not match
  20. NULL: Special value representing unknown/not applicable data

Common Board Exam Question Patterns

  1. Define terms (1 mark each): Relation, Tuple, Attribute, Domain, Degree, Cardinality, Primary Key, Foreign Key, Candidate Key, Alternate Key
  2. Differentiate between (2 marks): Primary Key vs Foreign Key, Degree vs Cardinality, Database Schema vs Database Instance, Candidate Key vs Primary Key
  3. Identify keys from a given table (2-3 marks): Given a relation schema, identify primary key, candidate key, foreign key, alternate key, composite key
  4. Limitations of file system (2-3 marks): List and explain any 3-4 limitations
  5. File System vs DBMS (2 marks): How does DBMS overcome file system limitations
  6. Properties of a relation (2 marks): Explain any two properties
  7. Can NULL be assigned? questions: Whether NULL can be in primary key (NO) or foreign key (YES)
  8. Degree and Cardinality calculation: Given a table, state degree and cardinality
  9. Design a database: Given a scenario, identify tables, attributes, primary keys, and foreign keys

Key Points Students Miss

  1. Primary key CANNOT be NULL but foreign key CAN be NULL
  2. Degree = number of columns, Cardinality = number of rows (students often confuse these)
  3. Sequence of tuples and attributes is immaterial in a relation (two tables with same data in different order are equivalent)
  4. Each attribute value must be atomic (no multi-valued fields allowed)
  5. Alternate key is simply the candidate key that was NOT selected as primary key
  6. A composite primary key is needed when no single attribute can uniquely identify rows (like AttendanceDate + RollNumber)
  7. Foreign key references the PRIMARY KEY of another table, not just any attribute
  8. Data Redundancy leads to Data Inconsistency, this cause-effect relationship is important
  9. Schema vs Instance: Schema is the design (does not change often), Instance is the actual data at a point in time (changes frequently)
  10. NULL is NOT the same as 0 or empty string, NULL means unknown/not applicable

Test Your Knowledge

Take a quick quiz on this chapter

Start Quiz →

Prefer watching over reading?

Subscribe for free.

Subscribe on YouTube