Dbms Samirgg
Dbms Samirgg
INTERNATIONAL SCHOOL OF
MANAGEMENT AND TECHNOLOGY
FACULTY OF COMPUTING
STUDENT DETAILS
STUDENT ID
ESTIMATED 5000
WORD LENGTH
Shankar chhetri
Page | 1
Database Management System
SUBMISSION
Shankar chhetri
Page | 2
Database Management System
When submitting assignments, each student must sign a declaration confirming that the work
is their own.
1. I declare that:
a) this assignment is entirely my own work, except where I have included fully-
documented references to the work of others,
b) the material contained in this assignment has not previously been submitted for any
other subject at the University or any other educational institution, except as
otherwise permitted,
c) no part of this assignment or product has been submitted by me in another (previous
or current) assessment, except where appropriately referenced, and with prior
permission from the Lecturer / Tutor / Unit Coordinator for this unit.
2. I acknowledge that:
a) if required to do so, I will provide an electronic copy of this assignment to the
assessor;
b) the assessor of this assignment may, for the purpose of assessing this assignment:
I. reproduce this assignment and provide a copy to another member of academic
staff;
II. communicate a copy of this assignment to a plagiarism checking service such
as Plagiarism Check (which may then retain a copy of this assignment on its
database for the purpose of future plagiarism checking).
Shankar chhetri
Page | 3
Database Management System
I am aware of and understand that any breaches to the Academic Code of Conduct will be
investigated and sanctioned in accordance with the College Policy.
Shankar chhetri
Page | 4
Database Management System
Table of Contents
List of Figures..................................................................................................................................6
Part 1................................................................................................................................................8
Introduction:................................................................................................................................8
Database:......................................................................................................................................8
Data Model and Its Types:...........................................................................................................9
Hierarchical Data Model:...................................................................................................10
Network Data Model:..........................................................................................................12
Relational Data Model:.......................................................................................................14
Entity-Relationship Model (ER Model):...........................................................................14
Object-Oriented Data Model:.............................................................................................16
Relational Model:.................................................................................................................17
Database Management Systems (DBMS).................................................................................19
Advantages of Database Management Systems:...............................................................20
Relational Database Management Systems (RDBMS).............................................................21
Key Concepts in RDBMS:...................................................................................................21
Normalization............................................................................................................................22
1. First Normal Form (1NF):..............................................................................................22
2. Second Normal Form (2NF):..........................................................................................22
3. Third Normal Form (3NF):............................................................................................22
Conclusion.................................................................................................................................25
Part 2..............................................................................................................................................27
Introduction................................................................................................................................27
Relational Database Management System (RDBMS):..............................................................27
Relationships between Entities:.................................................................................................27
One-to-One Relationship:...................................................................................................27
One to many /many to one..................................................................................................27
Many to many......................................................................................................................28
Client Requirements:.................................................................................................................28
Property Listings Management:.........................................................................................28
Customer Relationship Management (CRM):..................................................................28
Shankar chhetri
Page | 5
Database Management System
List of Figures
Figure 1 Hierarchical model example............................................................................................11
Figure 2 Network model example.................................................................................................13
Figure 3 Entity-Relationship model example................................................................................15
Figure 4 Object-Oriented model example.....................................................................................17
Figure 5 Property Management System ER diagram....................................................................30
Figure 6 Creating Database...........................................................................................................32
Figure 7 creating table for database...............................................................................................33
Figure 8 Creating table for database..............................................................................................34
Figure 9 inserting data in table......................................................................................................35
Figure 10 Values inserted in table.................................................................................................36
Figure 11 Complex queries uses....................................................................................................38
Figure 12 Costumer Login Page....................................................................................................38
Figure 13 Registration Page...........................................................................................................39
Shankar chhetri
Page | 6
Database Management System
Shankar chhetri
Page | 7
Database Management System
Part 1
Introduction:
In a dynamic real estate industry, Mega Build Estate's operational efficiency is based on a robust
database infrastructure carefully designed to manage a wide range of real estate information,
customer communications and reservations. Data models form the backbone of a system, from
conceptual frameworks to hierarchical structures, network architectures, relational databases, and
uni-relational models. These models, reinforced by object-oriented paradigms, ensure careful
storage and retrieval of data, characterized by their flexibility and adaptability. Integrated in this
framework is the concept of normalization, which combines data consistency with formats such
as 1NF, 2NF, and 3NF. At the heart of this complex network is a database management system
(DBMS), which is the cornerstone that facilitates seamless communication and usage. Using a
relational database management system (RDBMS), data is securely organized using
relationships, attributes, and keys. This advanced network gives Mega Build Estate a strategic
advantage in the highly competitive real estate environment, promoting operational efficiency
and data integrity.
Database:
The database acts as a huge archive similar to a carefully organized vault containing important
information about the Mega Build Estate. It serves as a special place where countless data about
properties, customer commitments and reservations are carefully stored and managed. Thanks to
a complex organizational system, the database ensures easy access to information and reduces
the risk of confusion or disorganization. In relation to Mega Build Estate, this database plays a
central role and is the foundation of the real estate website. It provides a structured and
systematic approach to data storage, retrieval and management, catalyzes operational efficiency
and reduces manual workload. In addition, it protects the sanctity and confidentiality of data
entrusted to Mega Build Estate and strengthens its reputation as a trusted custodian of sensitive
data.
Shankar chhetri
Page | 8
Database Management System
Diverse typologies of data models, including the relational model, hierarchical model, and
object-oriented model, proffer distinct paradigms for representing and manipulating data. The
intrinsic value of a well-crafted data model transcends mere conceptualization, encapsulating
critical elements of data integrity, consistency, and performance.
In essence, a robust data model underpins effective data management, furnishing the scaffolding
upon which scalable and maintainable database systems are erected. Across myriad domains,
spanning from commercial enterprises to scientific research endeavors, the foundational role of a
meticulously devised data model remains indelible, empowering organizations to navigate the
complexities of information management with finesse and efficacy.
In the realm of database management, various data models offer unique approaches to organizing
and structuring data. Let's delve into two distinctive models: the Hierarchical Data Model and the
Network Data Model.
Shankar chhetri
Page | 9
Database Management System
2. Parent-Child Relationship: Parent nodes can have multiple child nodes, but each child node
has only one parent.
3. Deletion Problem: If a parent node is deleted, its child nodes are automatically removed.
4. Pointers: Pointers establish connections between parent and child nodes, facilitating
navigation within the data structure.
Shankar chhetri
Page | 10
Database Management System
Example: In a network model, a student record may have two parents, such as the CSE
Department and the Library, allowing for more flexibility and interconnectedness.
Shankar chhetri
Page | 11
Database Management System
Shankar chhetri
Page | 12
Database Management System
In conclusion, while both the Hierarchical and Network Data Models offer distinct
advantages and challenges, their selection depends on the specific requirements and
complexities of the data management task at hand. Understanding these models
empowers database professionals to make informed decisions in designing efficient and
effective data storage systems.
The Relational Data Model boasts widespread adoption owing to its simplicity,
flexibility, and adherence to standardized querying languages such as SQL (Structured
Query Language). Notable implementations of this model include Oracle Database,
PostgreSQL, MySQL, and SQL Server. By encapsulating data in tabular form and
facilitating seamless interactions through relational operations, this model lays the
foundation for efficient data organization and retrieval.
Entity-Relationship Model (ER Model):
The Entity-Relationship (ER) Model stands as a graphical representation pivotal in structuring
and visualizing relationships among real-world entities within a database system. This model
employs entities to embody tangible or abstract objects, with relationships delineating
connections between these entities. Represented graphically, entities are depicted as rectangles,
Shankar chhetri
Page | 13
Database Management System
while relationships are illustrated through lines connecting entities. Attributes, intrinsic
characteristics of entities, further enrich the model by detailing specific properties.
1. Entities: Entities serve as the building blocks of the ER Model, embodying real-world entities
such as persons, places, or concepts. For instance, in a School Management System, entities may
include Teachers, Students, Courses, Buildings, and Departments.
2. Attributes: Within each entity lies a set of attributes, representing real-world properties
associated with the entity. For example, attributes of a Teacher entity may encompass
Teacher_ID, Salary, Age, and Mobile_Number.
3. Relationships: Relationships elucidate how entities are interrelated within the database
system. For instance, the relationship "Teacher works for a department" establishes a connection
between the Teacher and Department entities, signifying employment associations. Relationships
are vital in capturing the dependencies and interactions between entities, providing a holistic
view of the data model.
Consider an example illustrating the OODM, comprising objects like Employee and Department.
Each object encapsulates both data and behavior within a single unit. For instance, attributes
such as Name and Job_Title of an Employee object store relevant data, while methods associated
with the object dictate permissible operations. The relationship between Employee and
Department objects is established through a common attribute, such as Department_ID,
facilitating seamless communication and interaction between the two entities.
Shankar chhetri
Page | 15
Database Management System
Relational Model:
The Relational Model stands as the cornerstone of modern database management, revered for its
simplicity, scalability, and structural independence. Let's delve into the intricacies of this widely
adopted model, dissecting its features, advantages, and potential drawbacks.
At its core, the Relational Model organizes data within a two-dimensional structure which
resemble tables, where information is stored in rows and columns. Each table, also referred to as
a relation, represents a distinct entity or concept within the database. For instance, consider an
Employee table, where each row encapsulates details about a specific employee, such as name,
salary, and contact information.
Shankar chhetri
Page | 16
Database Management System
However, it's important to note that these disadvantages are relatively minor compared to
the manifold advantages offered by the Relational Model. With meticulous
implementation and adherence to best practices, organizations can mitigate these
challenges and leverage the model's strengths to build robust and efficient database
systems tailored to their specific needs. The Relational Model remains a cornerstone of
database management, offering a reliable framework for organizing and manipulating
data. Its simplicity, scalability, and structural independence make it an indispensable tool
in the realm of modern data management, empowering organizations to efficiently
manage their data assets and drive business success.
Physical Database: This component comprises a collection of files housing the actual
data.
Database Engine: The database engine is the software responsible for facilitating access
to and modification of the database contents.
Database Schema: The schema serves as a blueprint, specifying the logical structure of
the data stored within the database.
Shankar chhetri
Page | 18
Database Management System
software empowers users to create, update, and manage databases with enhanced
efficiency.
Improved Data Consistency: DBMS enforces data validation rules and constraints,
ensuring data consistency across various applications and users, thereby enhancing
overall data quality.
Improved Data Access and Availability: DBMS offers efficient data access and
retrieval mechanisms, enabling quick and easy data retrieval. It supports simultaneous
access by multiple users, ensuring data availability.
Improved Data Sharing: DBMS provides a platform for seamless data sharing across
different applications and users, fostering collaboration and decision-making within
organizations.
Improved Data Backup and Recovery: DBMS incorporates robust backup and
recovery mechanisms, safeguarding data against system failures. It enables the restoration
of data to a specific point in time, ensuring data consistency.
Shankar chhetri
Page | 19
Database Management System
Tuple: A tuple denotes a row or record in a table, representing a single instance or set of
data. Each row in the PropertyListings table, containing information about a particular
property, constitutes a tuple.
Key: A key is a field or group of fields that uniquely identifies a record in a table,
facilitating the establishment of relationships between tables.
Primary Key: The primary key serves as a unique identifier for each record in a table,
ensuring that each tuple can be uniquely identified. For example, the "PropertyID" in the
PropertyListings table acts as the primary key.
Shankar chhetri
Page | 20
Database Management System
Foreign Key: A foreign key is a field in one table that references the primary key in
another table, establishing a relationship between the two tables. For instance, the
"CustomerID" in the Interactions table could serve as a foreign key referencing the
"CustomerID" in the Customers table.
Normalization
Normalization, in the realm of database design, denotes the process of structuring data in a
manner that minimizes redundancy and enhances data integrity. It involves reorganizing tables
and columns to mitigate inconsistencies and ensure accurate and efficient data storage.
Normalization is categorized into different forms, each identified by a specific normal form
(NF):
1. First Normal Form (1NF): This form addresses the elimination of repeating groups within a
table by breaking it down into smaller, more manageable units. It ensures that each cell within
the table contains a single atomic value, thereby reducing redundancy.
2. Second Normal Form (2NF): Building upon the principles of 1NF, 2NF focuses on
eliminating partial dependencies. It ensures that all non-key attributes within the table are
functionally dependent on the entire primary key, rather than just a portion of it. This step
enhances data integrity and reduces anomalies in the database.
3. Third Normal Form (3NF): 3NF extends the normalization process by addressing transitive
dependencies. It ensures that no non-key attribute within the table is dependent on another non-
key attribute, thereby further enhancing data consistency and integrity.
Shankar chhetri
Page | 21
Database Management System
Initially, we begin with an unorganized table containing data that may exhibit redundancy and
dependency issues. Through the normalization process, we systematically transform this table
into a series of normalized forms:
First Normal Form (1NF): This form ensures that each cell within the table contains a single
atomic value, effectively eliminating repeating groups and enhancing data organization.
Shankar chhetri
Page | 22
Database Management System
Second Normal Form (2NF): By eliminating partial dependencies, 2NF ensures that all non-
key attributes are fully functionally dependent on the primary key. This step enhances data
integrity and reduces the risk of anomalies.
Third Normal Form (3NF): Finally, 3NF addresses transitive dependencies, ensuring that no
non-key attribute is dependent on another non-key attribute within the table. This further
enhances data consistency and integrity, completing the normalization process.
Shankar chhetri
Page | 23
Database Management System
Conclusion
In conclusion, the operational success of "Mega Build Estate" hinges on the implementation of a
streamlined and efficient database system. This system must adeptly manage property data, client
interactions, and booking processes. Understanding various data models, including hierarchical,
Shankar chhetri
Page | 24
Database Management System
network, and relational, is crucial for crafting effective databases. Among these, the relational
model stands out for its simplicity and scalability, making it a widely preferred choice.
In addition, the entity-relational model and the object-oriented data model offer valuable
advantages such as visual representation and code reuse. Central to relational database
management is a Relational Database Management System (RDBMS), such as MySQL, which
ensures data integrity, reduces redundancy and improves consistency.
In addition, the normalization process plays a key role in improving data integrity by removing
duplicate groups and dependencies. Basically, the strong database system of "Mega Build Estate"
acts as a cornerstone in the real estate market. It not only facilitates smooth operations but also
flexibly adapts to changing business requirements and ensures continued efficiency and success..
Shankar chhetri
Page | 25
Database Management System
Part 2
Introduction
In this project, the objective is to design a relational database management system (RDBMS)
tailored to meet the specific requirements of the client.
Example
Registration_id name
Program_id
1 Hari
1
2 Ram
2
Shankar chhetri
Page | 26
Database Management System
Registration_id name
Program_id
1 Hari
1
2 Ram
2
Many to many
Each row in one table can be related to multiple rows in another table, and vice versa.
Client Requirements:
Property Listings Management:
User-friendly interface for adding, editing, and removing property listings.
Detailed property information including location, type, price, size, amenities, and
availability status.
Advanced search and filtering options for potential buyers and tenants.
Shankar chhetri
Page | 27
Database Management System
This comprehensive RDBMS design will cater to the specific needs of the client, ensuring
efficient management of property listings, customer relationships, online bookings, and data
security.
Shankar chhetri
Page | 28
Database Management System
Shankar chhetri
Page | 29
Database Management System
Front-end Development:
HTML, CSS, and JavaScript formed the fundamental building blocks of the website's front-end.
HTML defined the structure of web pages, CSS enhanced visual presentation and layout, while
JavaScript added interactivity and dynamic content, making the website engaging and
responsive.
Back-end Development:
Python, renowned for its readability and simplicity, was chosen for backend development. With
frameworks like Django and Flask, Python streamlined backend logic, making development
efficient and scalable. Its clean syntax facilitated rapid development and maintenance of dynamic
web services.
Shankar chhetri
Page | 30
Database Management System
Shankar chhetri
Page | 31
Database Management System
Shankar chhetri
Page | 32
Database Management System
Creating Tables
Tables were created within the "Mega_Build_Estate" database to store different types of data
required for the website.
Shankar chhetri
Page | 33
Database Management System
Inserting Values:
After creating the tables, values were inserted into them to populate the database with relevant
data.
Shankar chhetri
Page | 34
Database Management System
Shankar chhetri
Page | 35
Database Management System
Program interface
A Python-based program interface was developed using the Flask framework and psycopg2
library to establish communication with the PostgreSQL database. Screenshots of the interface
interacting with the database and user interface were provided.
Shankar chhetri
Page | 36
Database Management System
SQL (Structured Query Language) was implemented to perform various database operations
such as data retrieval, modification, and deletion. Complex queries were optimized for better
performance.
Shankar chhetri
Page | 37
Database Management System
Shankar chhetri
Page | 38
Database Management System
Shankar chhetri
Page | 39
Database Management System
Shankar chhetri
Page | 40
Database Management System
Shankar chhetri
Page | 41
Database Management System
Shankar chhetri
Page | 42
Database Management System
Shankar chhetri
Page | 43
Database Management System
Shankar chhetri
Page | 44
Database Management System
Shankar chhetri
Page | 45
Database Management System
Test case
To assess the functionalities and performance of the development system, we conducted a series
of tests, the details of which are outlined below:
Shankar chhetri
Page | 46
Database Management System
Conclusion
In the real estate industry, building a robust relational database management system (RDBMS) is
a key undertaking. This requires the use of various tools and technologies such as Visual Studio
Code, HTML, CSS, JavaScript, Python with the Flask framework and PostgreSQL. Combining
these resources creates an advanced infrastructure that provides Mega Build Estate with a
versatile platform to streamline various aspects of its operations. At the core of this system's
functionality is its ability to provide a user-friendly interface that facilitates operations from
legacy inventory management to customer relationship management (CRM), online backup
functionality and efficient storage allocation. The inclusion of Create, Read, Update, Delete
(CRUD) functionality allows users to seamlessly add, modify and delete lists of database objects,
improving agility and responsiveness.
In addition, the design of the user interface is characterized by its adaptability and flexibility,
which ensures an intuitive and frictionless user experience for customers and internal
stakeholders. By prioritizing usability and accessibility, Mega Build Estate aims to
simultaneously improve customer satisfaction and operational efficiency. Implementation of
such a large-scale database system is not without challenges, as rigorous testing protocols are
required to verify its functionality and performance. Through thorough testing procedures,
potential problems or inefficiencies can be identified and proactively addressed. This ensures
that the final product perfectly meets the goals of the organization and meets the diverse needs of
its customer base. Developing and implementing an inherently robust RDBMS is a major
investment for Mega Build Estate, a cornerstone of its digital infrastructure. Using the latest
technology and best practices in database management, the organization is positioning itself for
sustainable growth and success in the competitive real estate industry.
References
Shankar chhetri
Page | 47
Database Management System
Shankar chhetri
Page | 48