Activity: DBMS Fundamentals

Comprehensive guide to DBMS concepts, types, relational model, and keys

Grade XII • Computer Science ⏱ ~25 min

Prerequisites

Objectives Learning Goals & Outcomes

By the end of this activity, you will be able to:

Real-World Application: DBMS concepts power every modern application — from school record systems to banking, healthcare, e-commerce, and social media platforms.

Part 1 Data, Information & DBMS

Data vs. Information

AspectDataInformation
DefinitionRaw, unorganized facts that need processingData that has been processed and organized to be meaningful
ContextIn computer science: raw input (numbers, characters, symbols). In statistics: numerical facts. In business: facts used for decision-making.In computer science: processed output. In statistics: data organized into tables/charts. In business: analyzed data for decisions.
Example“9841-234567”, “25, 30, 45”“Ram Sharma, Roll 12, Class XII”, “Average age is 17.5”
NatureUnprocessed, isolated factsProcessed, contextualized, useful

Activity 1.1 — Data or Information?

  1. “23, 45, 67” Data (raw numbers)
  2. “The average score is 45” Information (processed result)
  3. “Delhi, Mumbai, Kolkata” Data (raw city names)
  4. “5 students are from Delhi” Information (aggregated data)

What is a Database?

A database is a structured collection of data stored electronically. It allows organized storage, retrieval, and management of data.

Examples: School student records, hospital patient databases, electricity billing systems, library catalogs, phone contacts.

What is a DBMS?

A Database Management System (DBMS) is software that allows users to create, define, manipulate, and manage databases. It acts as an interface between the user and the database.

History of DBMS:

YearMilestone
1960Charles Bachman designed the first DBMS system
1970Codd introduced IBM’s Information Management System (IMS)
1976Peter Chen coined the Entity-Relationship (ER) model
1980Relational model becomes a widely accepted database component
1985Object-oriented DBMS develops
1991Microsoft ships MS Access, a personal DBMS
1995First Internet database applications
1997XML applied to database processing

Four Main Types of DBMS:

TypeDescriptionExample
HierarchicalTree-like structure with parent-child relationships. A parent can have multiple children, but a child has only one parent.Windows Registry, IBM’s IMS
NetworkExtends the hierarchical model. A child can have multiple parents, enabling many-to-many relationships.RDM Server
RelationalData is organized in tables (relations) with rows and columns. Keys establish relationships between tables. Most widely used today.MySQL, Oracle, PostgreSQL, SQL Server
Object-OrientedData is stored as objects with attributes and methods. Supports all data types including multimedia.PostgreSQL, db4o

Which is most widely used? Relational DBMS (RDBMS)

What is a Data Warehouse?

A data warehouse is an information system that contains historical and cumulative data from one or multiple sources. It facilitates a single version of truth for a company for decision making and forecasting. It simplifies the reporting and analysis process of the organization.

Part 2 Types of Databases

Flat File vs. Relational Databases

FeatureFlat FileRelational
StructureSingle table with rows of informationMultiple tables with rows and columns; relationships between tables
Data VolumeSmall amount of dataCan handle large volumes of data
RelationshipsNo relationships between dataKeys used for linking related data across tables
SecurityLess secureIncreased security
Multi-userLimited accessMany users can work simultaneously from different locations
ExamplePhone contacts listMySQL, Oracle, SQL Server

Centralized vs. Distributed Databases (Overview)

FeatureCentralizedDistributed
LocationSingle site/locationMultiple sites across a network
CostCheaperMore expensive
SecuritySingle point of failureData spread across locations — more resilient
ScalabilityHarder to scaleEasier to expand
ComplexitySimpler to manageMore complex to maintain

Compact Reference: All Database Types

TypeDescriptionKey Example
PersonalSmall databases on personal computers, used by a small group within one departmentMS Access
Object-orientedStores data as objects with attributes and methods; supports all data typesPostgreSQL
Open-sourceFree-to-use databases for operations like marketing, HR, customer serviceMySQL, MariaDB
CloudOptimized for virtualized environments; scalable on-demand, high availabilityAmazon RDS, Google Cloud SQL
NoSQLHandles large sets of distributed data; efficient for unstructured dataMongoDB, Cassandra
GraphUses graph theory to store, map, and query relationshipsNeo4j
OLTPFast query processing; maintains data integrity in multi-access environmentsMySQL (transactional)
Document/JSONStores data in document collections (XML, JSON, BSON); flexible schemaMongoDB, CouchDB
HierarchicalParent-child tree structure; one parent, many childrenWindows Registry
NetworkMany-to-many parent-child links; more flexible than hierarchicalRDM Server
MultimodalSupports multiple data models in a single databaseAzure Cosmos DB
Part 3 Database Components

Five Components of a Database System

  1. Hardware — Physical electronic devices: computers, I/O devices, storage devices. Provides the interface between computers and real-world systems.
  2. Software — Programs to manage and control the database: DBMS software, operating system, network software, and application programs.
  3. Data — Raw and unorganized facts (numbers, characters, symbols, images) that need processing to become meaningful.
  4. Procedure — Instructions and rules for using the DBMS: documented methods for designing, running, and managing the database.
  5. Database Access Language — Language used to access, enter, update, and retrieve data (e.g., SQL). Users write commands and submit them to the database.

Advantages of DBMS

  1. Offers a variety of techniques to store and retrieve data.
  2. Efficient handler to balance the needs of multiple applications using the same data.
  3. Uniform administration procedures for data.
  4. Application programmers are never exposed to details of data representation and storage.
  5. Uses powerful functions to store and retrieve data efficiently.
  6. Offers Data Integrity and Security.
  7. Imposes integrity constraints for high-level protection against unauthorized access.
  8. Schedules concurrent access so that only one user accesses the same data at a time.
  9. Reduced Application Development Time.

Disadvantages of DBMS

  1. High cost — Hardware and software costs are quite high, increasing the organization’s budget.
  2. Complexity — Most DBMS are complex; training is required for users.
  3. Single point of failure — In some setups, all data in a single database can be lost due to power failure or corruption.
  4. Data loss risk — Multiple concurrent users can sometimes lead to data loss.
  5. Limited computation — DBMS cannot perform sophisticated calculations.
Part 4 The Relational Model

Tables, Attributes, Tuples & Fields

The relational model expresses data and relationships in the form of tables (also called relations).

Example — Student Relation:

Roll_NoNameDepartment
1RamScience
2SitaArts
3HariCommerce
4GitaScience
5ShyamArts

Roll_No, Name, and Department are attributes. Each row is a tuple. Each cell value is a field.

Characteristics of the Relational Model

  1. Each relation in a database must have a distinct (unique) name to separate it from others.
  2. A relation must not have two attributes with the same name; each attribute must be distinct.
  3. Duplicate tuples must not be present in a relation.
  4. Each tuple must have exactly one data value for each attribute (atomic values).
  5. Tuples in a relation do not need to follow a significant order — relations are not order-sensitive.
  6. Attributes of a relation also do not need to follow a specific order.

Popular RDBMS

VendorRDBMS Products
IBMDB2, Informix Dynamic Server
OracleOracle, RDB
MicrosoftSQL Server, Access
Part 5 Keys in Relational Databases

Keys are fundamental to the relational model. A key is a value (or set of values) used to identify a record in a table uniquely. Keys can also establish relationships among columns and tables.

Activity 5.1 — Types of Keys (Definitions & Examples)

Given the Student table: Student_ID, Roll_No, Name, Dept_ID, Phone

Key TypeDefinitionExample from Student Table
Candidate Key Minimal set of attributes that can uniquely identify a tuple. Every table must have at least one. Value is unique and may be null. Student_ID and Roll_No (both are individually unique)
Primary Key A single column (or chosen candidate key) that uniquely identifies each record. Cannot be NULL. Must be unique. Should rarely change. Student_ID (selected as the primary key)
Super Key Any set of attributes that can uniquely identify a tuple. Created by adding zero or more attributes to a candidate key. Supports NULL values. (Student_ID), (Student_ID, Name), (Roll_No, Phone)
Alternate Key A candidate key that is not chosen as the primary key. All non-primary candidate keys are alternate keys. Roll_No (candidate key but not the primary key)
Foreign Key A column (or set) that references the primary key of another table. Links tables together. Does not need to be unique. Can be NULL. Dept_ID (references Primary Key of Department table)
Composite Key A combination of two or more columns used to uniquely identify rows. Can serve as a primary key when no single column is unique enough. (Student_ID, Phone) used together as a composite key

Activity 5.2 — Key Identification Practice

In the Employee table: Emp_ID, Emp_Name, PAN_Number, Dept_ID, Salary. Emp_ID is the primary key and PAN_Number is also unique.

  1. Primary Key: Emp_ID
  2. Candidate Keys: Emp_ID and PAN_Number
  3. Alternate Key: PAN_Number (candidate key not chosen as primary)
  4. Foreign Key: Dept_ID (references Department table)
  5. Super Key: (Emp_ID, Emp_Name) — any superset of a candidate key
Part 6 Relational Integrity Constraints

Integrity constraints are conditions that must hold for a relation to be valid. They are derived from real-world rules the database represents.

Three Main Categories

ConstraintDescriptionExample
Key Constraints There must be at least one set of attributes (a key) that can uniquely identify each tuple. No two tuples can have identical values for all key attributes. In Student table, Student_ID must be unique for every student record.
Domain Constraints Each attribute must only take values from its defined domain (data type, range, format). Salary cannot be negative; Age must be a positive integer; Phone must be 10 digits.
Referential Integrity Constraints A foreign key value must either match an existing primary key value in the referenced table or be NULL. Ensures valid references between tables. Dept_ID in the Student table must match a valid Dept_ID in the Department table.
Part 7 Operations in Relational Model

Four basic update operations performed on relational databases:

OperationPurposeExample
InsertAdds new data (tuples) into a relationAdding a new student record to the Student table
UpdateModifies existing values in tuplesChanging a student’s department or phone number
DeleteRemoves tuples from the tableRemoving a student record after graduation
SelectRetrieves a specific range of data that matches given conditionsSelecting all students from the Science department

Important: Whenever any of these operations are applied, all integrity constraints specified on the database schema must never be violated.

Part 8 Advantages & Disadvantages of the Relational Model

Advantages of the Relational Model

  1. Simplicity: Simpler than the hierarchical and network models.
  2. Structural Independence: Only concerned with data, not with internal structure — improves performance.
  3. Easy to Use: Tables with rows and columns are natural and simple to understand.
  4. Query Capability: High-level query languages (like SQL) avoid complex database navigation.
  5. Data Independence: Database structure can be changed without modifying applications.
  6. Scalable: Can be enlarged by adding more records (rows) and fields (columns) to enhance usability.

Disadvantages of the Relational Model

  1. Field length limits: Some relational databases have limits on field lengths that cannot be exceeded.
  2. Complexity with growth: As data grows and relationships become more complicated, the database can become complex.
  3. Isolated databases: Complex systems may lead to isolated databases where information cannot be shared across systems.
Challenge Quiz: Test Your DBMS Knowledge

1. Which of the following is raw, unorganized facts that need processing?

  • Information
  • Data
  • Database
  • Data Warehouse
Show answer
Data — data is raw and unorganized; information is data that has been processed.

2. Which DBMS type uses a tree-like structure with parent-child relationships where a child has only one parent?

  • Relational
  • Network
  • Hierarchical
  • Object-Oriented
Show answer
Hierarchical — e.g., Windows Registry.

3. In the Student table, Student_ID is the primary key. Roll_No is also unique but not chosen as primary key. What type of key is Roll_No?

  • Foreign Key
  • Super Key
  • Composite Key
  • Alternate Key
Show answer
Alternate Key — a candidate key not chosen as the primary key.

4. A foreign key in a table is used to:

  • Uniquely identify each record in its own table
  • Link to the primary key of another table
  • Prevent duplicate values in its own table
  • Store derived values
Show answer
Link to the primary key of another table — it establishes relationships between tables.

5. Which integrity constraint ensures that a Dept_ID in the Student table matches a valid Dept_ID in the Department table?

  • Key Constraint
  • Domain Constraint
  • Referential Integrity Constraint
  • Entity Constraint
Show answer
Referential Integrity Constraint — foreign key values must reference valid primary key values in the referenced table.
Assessment Prep Ready for the Interactive Assessment

What to Expect in the Assessment:

Key Points to Remember: