Syllabus topics (RTMNU)
- Data, Information, Metadata, Data dictionary
- Database, Components of a database
- DBMS, Components of DBMS
- Traditional File System Versus Database Systems
- Disadvantages of traditional file system
- Database systems, Advantages and Disadvantages of database systems
- DBMS Users
- Schemas, Subschema and Instances
- Three Level Architecture of Database Systems (DBMS)
- Data independence
- File Organization, Basic Concepts of Files
- Records and record types
- Types of files
- File Organization Techniques
Data, Information, Metadata and Data Dictionary
- Data β raw facts and figures without meaning by themselves, e.g. 101, "Riya", 78.
- Information β processed, organised data that has meaning, e.g. "Roll no. 101 Riya scored 78 marks".
- Metadata β "data about data": describes the data, e.g. field name Marks, type NUMBER, size 3.
- Data dictionary β a central store of metadata in a DBMS, listing all tables, fields, data types, sizes, constraints, relationships and users. It is maintained by the DBMS and used by the DBA.
Database and its Components
A database is an organised collection of logically related data stored so that it can be easily accessed, managed and updated. Example: a college database with student, course and fee tables.
Components of a database system: (1) Data β the actual stored data and metadata; (2) Hardware β computers, storage, network; (3) Software β the DBMS and application programs; (4) Users β people who use the database; (5) Procedures β rules and instructions for using the database.
DBMS and its Components
A Database Management System (DBMS) is software that allows users to create, store, retrieve, update and manage data in a database while controlling access and keeping the data safe and consistent. Examples: Oracle, MySQL, MS SQL Server, PostgreSQL, MS Access.
Components of DBMS:
- DDL compiler β processes table definitions and stores them in the data dictionary.
- DML compiler / query processor β translates queries into low-level instructions and optimises them.
- Storage manager β handles storage, retrieval and updating of data on disk (file manager, buffer manager).
- Transaction manager β ensures transactions are complete and correct (ACID properties).
- Concurrency control manager β manages many users working at the same time.
- Recovery manager β restores data after failure using backups and logs.
- Authorisation and integrity manager β checks access rights and constraints.
- Data dictionary.
Traditional File System versus Database System; Disadvantages of File System
In a traditional file system, each department keeps its own separate files and programs (e.g. accounts and exam sections each keep their own student files).
Disadvantages of the file system:
- Data redundancy β same data repeated in many files.
- Data inconsistency β copies do not match after an update in only one place.
- Difficulty in accessing data β a new program is needed for each new query.
- Data isolation β data scattered in different files and formats.
- Integrity problems β rules (e.g. marks β€ 100) hard to enforce.
- Atomicity problems β a failure can leave half-completed updates.
- Concurrent access anomalies β two users updating together cause errors.
- Security problems β hard to restrict access.
| Basis | File system | Database system (DBMS) |
|---|---|---|
| Redundancy | High | Controlled |
| Consistency | Poor | Maintained |
| Data sharing | Difficult | Easy |
| Security | Weak | Strong (user rights) |
| Backup and recovery | Manual | Built in |
| Querying | Program for each query | SQL queries |
| Cost | Low | Higher |
Advantages and Disadvantages of Database Systems
Advantages: controlled redundancy; consistency; data sharing; data integrity; security; backup and recovery; concurrency control; data independence; easy querying with SQL; standards enforced.
Disadvantages: high cost of software, hardware and trained staff; complexity; large size; failure of the central database affects all users; performance may be slower for very simple applications.
DBMS Users
- Database Administrator (DBA) β controls the whole database: designs schema, grants access, backup, recovery, performance.
- Database designers β decide tables, fields and relationships.
- Application programmers β write programs that use the database.
- Sophisticated users β analysts who write their own SQL queries.
- Naive (end) users β use ready-made applications, e.g. bank clerk, ATM user, railway booking clerk.
Schemas, Subschema and Instances
- Schema β the overall logical design/structure of the database (tables, fields, types, relationships). It changes rarely. E.g. STUDENT(RollNo, Name, Course).
- Subschema β a part of the schema seen by a particular user or application (a user view).
- Instance β the actual data stored in the database at a particular moment; it changes often.
Three-Level Architecture (ANSI/SPARC) and Data Independence
- External level (view level) β how individual users see the data; many external views (subschemas).
- Conceptual level (logical level) β the whole database for the community of users: entities, attributes, relationships, constraints; hides storage details.
- Internal level (physical level) β how data is actually stored on disk: files, indexes, record formats.
Data independence β the ability to change the schema at one level without changing the next higher level.
- Physical data independence β change in internal level (new index, storage device) does not affect the conceptual schema.
- Logical data independence β change in conceptual schema (adding a new field or table) does not affect external views/application programs. It is harder to achieve.
File Organization: Files, Records, Record Types and Types of Files
A field is a single data item (Name); a record is a group of related fields (one student's details); a file is a collection of related records.
Record types: fixed-length records (every record same size β simple, may waste space) and variable-length records (size varies β saves space, harder to manage).
Types of files: master file (permanent data, e.g. customer master), transaction file (day-to-day transactions), reference/table file (tax rates, price lists), backup file, archive file, report file.
File Organization Techniques
- Sequential (serial) file β records stored one after another in key order; good for batch processing (payroll); slow for searching one record.
- Heap (pile) file β records stored in the order they arrive; fast insertion, slow search.
- Indexed sequential (ISAM) β records in key order plus an index for direct access; supports both sequential and random access.
- Direct/random (hashed) file β a hash function on the key gives the address of the record; very fast access (e.g. ATM account lookup).
- Clustered file β related records from different tables stored close together.
Likely exam questions
- (Long, 8/16 marks) What is a DBMS? Explain its components and compare a traditional file system with a database system.
- (Long, 8/16 marks) Explain the three-level architecture of DBMS and data independence.
- (Short, 4 marks) Define: data, information, metadata and data dictionary.
- (Short, 4 marks) Explain schema, subschema and instance.
- (Short, 4 marks) Explain any three file organization techniques.