Before connecting Python to a database, you need a clear idea of what a database is and why organisations use database systems instead of ordinary files.
Database and DBMS
Users of a DBMS
User
Role
End users
Use applications built on the database (students, bank customers, clerks)
Application programmers
Write programs (in Python, Java, etc.) that access the database
Database designers
Decide the structure: entities, relationships, tables, constraints
Database administrators (DBA)
Install, configure, back up, secure and tune the DBMS; grant permissions
Advantages and limitations
Advantages over separate files
Limitations
Reduced redundancy: data stored once, centrally
Hardware, software and licence costs
Consistency: one copy, so updates are seen everywhere
Complex to design and administer
Sharing by many users and programs at once
Staff need training
Integrity: rules (constraints) keep data valid
A failure of the central database affects all applications
Security: authentication and access rights
Conversion from old file systems takes effort
Data independence: programs are not tied to storage details
Some overhead for very small, simple tasks
Backup, recovery and concurrency control built in
Example of inconsistency without a database: a student’s new address is updated in the examination file but not in the accounts file, so the two departments disagree.
Architecture
Most applications today use a three-tier architecture:
Three-tier architecture
Presentation tier Application tier Data tier(browser, mobile app) <--> (web/app server running <--> (DBMS: MySQL server business logic, e.g. storing the data) Python code)
Each tier can be changed or scaled independently; users never connect to the database directly.
The three-schema architecture separates three views of the same database:
Level
Describes
Who uses it
External (view) level
The part of the data each user group sees
End users, applications
Conceptual (logical) level
All entities, attributes, relationships and constraints
Designers, DBA
Internal (physical) level
How data is stored on disk: files, indexes
DBMS, DBA
This separation gives data independence: the physical storage can change without changing programs (physical independence), and the logical design can grow without changing every user’s view (logical independence).
Key takeaways
Database = organised, shared, persistent data; DBMS = software that manages it.
Users: end users, programmers, designers, administrators.
DBMS benefits: less redundancy, consistency, sharing, integrity, security, independence.
Answer on paper first, then check. The explanation matters more than the letter you chose.
Question 6 · short answer
Explain, with an example, how a DBMS ensures data consistency compared with a file-based system.
Show worked answer
In a file-based system each department keeps its own copy of shared data, so an update made in one file may not be made in the others. For example, if a student’s phone number is changed in the examination file but not in the hostel file, the two records disagree. In a DBMS the student’s details are stored once in a central table; every department reads the same row, so a single update is immediately seen by all users, and the data stays consistent.
MCA Online notes are made for reading on screen. Open https://mcastudy.online/mcs-201/data-access-using-python/databases-and-database-management-systems/ to read this page.