UNIT – I INTRODUCTION TO DATABASE MANAGEMENT SYSTEM An overview of database management system – What is Data? Data is nothing but facts and statistics stored or free flowing over a network, generally it's raw and unprocessed. For example: When you visit any website, they might store you IP address, that is data, in return they might add a cookie in your browser, marking you that you visited the website, that is also data. Data becomes information when it is processed, turning it into something meaningful. Like, based on the cookie data saved on user's browser, if a website can analyze that generally men of age 20-25 visit us more, that is information, derived from the data collected. What is a Database? A Database is a collection of related data organized in a way that data can be easily accessed, managed and updated. Database can be software based or hardware based, with one sole purpose, storing data. During early computer days, data was collected and stored on tapes, which were mostly write-only, which means once data is stored on it, it can never be read again. They were slow and bulky, and soon computer scientists realized that they needed a better solution to this problem. What is DBMS and its Types? A collection of information which is managed such that it can be updated and easily accessed is called a database. A software package which can be used to manipulate, validate and retrieve this database is called a Database Management System. For example, Airlines use this software package to book tickets and confirm reservations which are then managed to keep a track of the schedule. In other words, A DBMS is a software that allows creation, definition and manipulation of database, allowing users to store, process and analyze data easily. DBMS provides us with an interface or a tool, to perform various operations like creating database, storing data in it, updating data, creating tables in the database and a lot more. DBMS also provides protection and security to the databases. It also maintains data consistency in case of multiple users. Here are some examples of popular DBMS used these days: MySql Oracle SQL Server IBM DB2 PostgreSQL Amazon SimpleDB (cloud based) etc. There are majorly four types of databases: Network Database:When the details of multiple members can be linked to the files of multiple owners and vice versa, it is called a network database. Hierarchical Database:When the data stored in the form of records and is connected to each other through links is called hierarchical database. Each record comprises fields and each field comprises only one value. Relational Database:When the data is organized as a set of tables comprising rows and columns with a pre-defined relationship with one another, it is called a relational database. Object-oriented Database– the information is represented as objects, with different types of relationships possible between two or more objects. Such databases use an object-oriented programming language for development. Components of Database Management Software: There four main components on which the working of a DBMS depends. This includes: 1. Data:The main component is the data. The entire database is set based on the data and the information processed based on it. This data acts as a bridge between the software and hardware components of DBMS. This can further be divided into three varieties: User Data –The actual data based on which the work is done Metadata –This is the data of the data, i.e., managing the data required to enter the information Application MetaData –This is the structure and format of the queries To simplify it, in a table, the information given in each table is the User Data, the number of tables, rows and columns is the MetaData the structure we choose is the Application MetaData. 2. Hardware:These are the general hardware devices which help us save and enter the data like hard disks, magnetic tapes, etc. 3. Software:The software acts as a medium of communication between the user and the database. Based on the user’s requirement, the database can be modified and updated. To perform operations on the data, query languages like SQL are used. 4. Users:No function can be performed without the Users. Thus, they form the fourth most important component of DBMS. The information entered into a database is used by the User or the administrator to perform their business operations and responsibilities. Characteristics of Database Management System: A database management system has following characteristics: 1. Data stored into Tables:Data is never directly stored into the database. Data is stored into tables, created inside the database. DBMS also allows to have relationships between tables which makes the data more meaningful and connected. You can easily understand what type of data is stored where by looking at all the tables created in a database. 2. Reduced Redundancy:In the modern world hard drives are very cheap, but earlier when hard drives were too expensive, unnecessary repetition of data in database was a big problem. But DBMS follows Normalization which divides the data in such a way that repetition is minimum. 3. Data Consistency:On Live data, i.e. data that is being continuously updated and added, maintaining the consistency of data can become a challenge. But DBMS handles it all by itself. 4. Support Multiple user and Concurrent Access:DBMS allows multiple users to work on it (update, insert, delete data) at the same time and still manages to maintain the data consistency. 5. Query Language:DBMS provides users with a simple Query language, using which data can be easily fetched, inserted, deleted and updated in a database. 6. Security:The DBMS also takes care of the security of data, protecting the data from un-authorized access. In a typical DBMS, we can create user accounts with different access permissions, using which we can easily secure our data by restricting user access. 7. DBMS supports transactions, which allows us to better handle and manage data integrity in real world applications where multi-threading is extensively used. Advantages of DBMS: 1. Segregation of application program. 2. Minimal data duplicacy or data redundancy. 3. Easy retrieval of data using the Query Language. 4. Reduced development time and maintenance need. 5. With Cloud Data centers, we now have Database Management Systems capable of storing almost infinite data. 6. Seamless integration into the application programming languages which makes it very easier to add a database to almost any application or website. Disadvantages of DBMS: 1. It's Complexity 2. Except MySQL, which is open source, licensed DBMSs are generally costly. 3. They are large in size. What is a File System? The operating system’s file system is a mechanism and data structure for controlling how data is saved and accessed. Data deposited in a storage medium without a file system would be one huge body of data with no way of knowing where one piece of data ends and the next begins. The data is easily extracted and identified by splitting it into bits and giving each one a name. Each group of data is referred to as a “file”. A “file system” is the structure and logic rules that are used to organize groups of data and their names. Files can be collectively present inside a directory. Directories can again be present inside another directory giving it a hierarchical structure. Although Windows supports a variety of file systems, NTFS is the most popular in today’s world. Because files are commonly organized in a hierarchy, the file system allows you to browse the files in the current directory. Database System versus File System: Key difference between File System and DBMS A file system is software that manages and organizes the files in a storage medium, whereas a DBMS is a software application that is used for accessing, creating, and managing databases. The file system doesn’t have a crash recovery mechanism; on the other hand, the DBMS provides a crash recovery mechanism. Data inconsistency is higher in the file system. On the contrary, data inconsistency is low in a database management system. File system does not provide support for complicated transactions, while in the DBMS system, it is easy to implement complicated transactions using SQL. File system does not offer concurrency, whereas the DBMS provides a concurrency facility. Parameters DBMS File System Structure Store the data as a Stores the data as a table, key-value format hierarchical structure or a graph. where files are children of directories (parent). Data Performs normalization No way to refer the data Redundancy and referencing to in file avoid system, hence causing redundancy. redundancy. Backup and Allows for automated Usually have to perform Recovery backup and recovery of manual backup and the data. recovery operations Query Queries process faster Queries usually take time Processing due to efficient data due to unavailability of structures and advanced fetching indexing, caching algorithms. support. Consistency Complexity It has ACID properties Lacks any mechanism for which help in data data consistency. consistency. More complex due to a Simpler than DBMS due to lot of less features and data number of features. management methods. Cost Cost is high due to a lot Less costly due to simpler of features. advanced features like distributed computing, load balancing, etc. What is Database Architecture? A Database Architecture is a representation of DBMS design. It helps to design, develop, implement, and maintain the database management system. A DBMS architecture allows dividing the database system into individual components that can be independently modified, changed, replaced, and altered. It also helps to understand the components of a database. A Database stores critical information and helps access data quickly and securely. Therefore, selecting the correct Architecture of DBMS helps in easy and efficient data management. Types of DBMS Architecture: There are mainly three types of DBMS architecture: One Tier Architecture (Single Tier Architecture) Two Tier Architecture Three Tier Architecture 1-Tier Architecture1 Tier Architecture in DBMS is the simplest architecture of Database in which the client, server, and Database all reside on the same machine. A simple one tier architecture example would be anytime you install a Database in your system and access it to practice SQL queries. But such architecture is rarely used in production. 2-Tier Architecture- A 2 Tier Architecture in DBMS is a Database architecture where the presentation layer runs on a client (PC, Mobile, Tablet, etc.), and data is stored on a server called the second tier. Two tier architecture provides added security to the DBMS as it is not exposed to the end-user directly. It also provides direct and faster communication. In the above 2 Tier client-server architecture of database management system, we can see that one server is connected with clients 1, 2, and 3. Two Tier Architecture Example: A Contact Management System created using MS- Access. 3-Tier ArchitectureA 3-Tier Architecture in DBMS is the most popular client server architecture in DBMS in which the development and maintenance of functional processes, logic, data access, data storage, and user interface is done independently as separate modules. Three Tier architecture contains a presentation layer, an application layer, and a database server. 3-Tier database Architecture design is an extension of the 2tier client-server architecture. A 3-tier architecture has the following layers: 1. Presentation layer (your PC, Tablet, Mobile, etc.) 2. Application layer (server) 3. Database Server The Application layer resides between the user and the DBMS, which is responsible for communicating the user’s request to the DBMS system and send the response from the DBMS to the user. The application layer (business logic layer) also processes functional logic, constraint, and rules before passing data to the user or down to the DBMS. The goal of Three Tier client-server architecture is: To separate the user applications and physical database To support DBMS characteristics Program-data independence Supporting multiple views of the data Three Tier Architecture Example: Any large website on the internet. What are Data Models in DBMS? The Data Model gives us an idea of how the final system would look after it has been fully implemented. It specifies the data items as well as the relationships between them. In a database management system, data models are often used to show how data is connected, stored, accessed, and changed. We portray the information using a set of symbols and language so that members of an organization may understand and comprehend it and then communicate. Types of Data Models: Though there are other data models in use today, the Relational model is the most used. Aside from the relational model, there are a variety of different data models that we shall discuss in-depth in this article. Data Models in DBMS include the following: 1. Hierarchical Model This concept uses a hierarchical tree structure to organize the data. The hierarchy begins at the root, which contains root data, and then grows into a tree as child nodes are added to the parent node. The Hierarchical Model was the first database management system model. This concept uses a hierarchical tree structure to organize the data. The hierarchy begins at the root, which contains root data, and then grows into a tree as child nodes are added to the parent node. This model accurately depicts several real-world relationships such as food recipes, website sitemaps, and so on. Example: The following diagram depicts the relationship between the shoes available on a shopping website: Features of a Hierarchical Model: Parent – Child Relationship A parent node exists for each child node. However, a parent node might have several child nodes. It is not permitted to have more than one parent. One -to-Many Relationship The data is organized in a tree-like form, with the datatypes having a one-to-many relationship. There can only be one path from any node to its parent. For example, in the preceding example, there is only one way to get to the node ‘sneakers’, which is through the ‘men’s shoes’ node. Deletion Problem When a parent node is removed, the child node is removed as well. Pointers Pointers are used to connect the parent and child nodes and to traverse and navigate between the stored data. The ‘shoes’ node in the above example points to the two additional nodes, ‘women’s shoes’ and ‘men’s shoes.’ Pros of Hierarchical Model: A tree-like structure is incredibly straightforward and quick to navigate. Any modification to the parent node is reflected automatically in the child node, ensuring data integrity. Cons of Hierarchical Model: Relationships that are complex are not supported. Because it only supports one parent per child node, if we have a complex relationship in which a child node needs to have two parents, we won’t be able to describe it using this model. When a parent node is removed, the child node is removed as well. 2. Network Model: The hierarchical model is extended in the network model. Prior to the relational model, it was the most popular model. To increase database performance and standards, the network model was devised to express complicated data relationships more effectively than hierarchical models. It has entities that are grouped in a graphical format, and some of the entities can be reached by many paths. Example: We can observe that the node student has two parents, CSE Department and Library, in the example below. In the hierarchical model, this was previously impossible. Features of a Network Model: Multiple Paths There may be several paths to the same record due to the increased number of relationships. It allows for quick and easy data access. The Ability to merge more Relationships Data is more connected in this model since there are more relationships. This paradigm can handle many-to-many as well as one-to-one relationships. Circular Linked List The circular linked list is used to perform operations on the network model. The present position is kept up to date with the help of a software, and it navigates through the records based on the relationship. Pros of Network Model In comparison to the hierarchical model, data can be retrieved faster. This is because the data in the network model is more related, and there may be more than one path to a given node. As a result, the data can be accessed in a variety of ways. Data integrity is present since there is a parent-child relationship. Any changes to the parent record are mirrored in the child record. Cons of Network Model As the number of relationships to be managed grows, the system may get increasingly complicated. To operate with the model, a user must have a thorough understanding of it. Any alteration, such as an update, deletion, or insertion, is extremely difficult. 3. Entity – Relationship Model: In the ER (Entity-Relationship) database model, real-world objects of interest are represented as entities, while their properties or details are captured as attributes. Relationships between these entities are established to show how they are connected. ER models use diagrams (ER diagrams) to visually represent these entities and relationships, making it easier for stakeholders—such as developers, analysts, and clients—to understand the database structure. For example, when designing a school database, a Student can be an entity with attributes like name, age, and address. Since an address is often a complex structure, it can be modeled as a separate entity with its own attributes such as street, pincode, and city. A relationship is then defined between the Student and Address entities. ER diagrams also support different types of relationships (e.g., one-to-one, one-tomany, many-to-many), which further help in modeling real-world scenarios accurately. To explore more, you can study ER diagrams in detail to understand how entities and relationships work together. Advantages of the ER Model The ER (Entity-Relationship) model is simple to understand and easy to design, making it accessible to both technical and non-technical users. It provides a clear and logical way to represent data structures visually. Although the ER model is not directly implemented in databases, it serves as a blueprint for designing relational database models. 4. Relational Model The relational model organizes data into two-dimensional tables, known as relations, where each table represents a specific type of data. Relationships between tables are maintained through common fields (also called foreign keys). Introduced by E.F. Codd in 1970, this model has become the most widely used approach to database management. Each table contains rows (records) and columns (attributes), with all data related to a specific entity type stored within a single table. You can design, structure, and normalize these tables to reduce data redundancy and improve consistency. Data is accessed and manipulated using SQL (Structured Query Language). Popular relational databases include Oracle, MySQL, PostgreSQL, and Microsoft. Advantages of the Relational Model The relational model is straightforward and easy to implement, making it ideal for a wide range of applications. A variety of popular database software—such as Oracle, MySQL, PostgreSQL, and SQL Server—are built on this model. It supports SQL (Structured Query Language), allowing users to efficiently query, manipulate, and manage data. 5. Object-Oriented Model In the object-oriented database model, data is stored in the form of objects, similar to how it's structured in object-oriented programming (OOP) languages like Java or C++. Objects in this model encapsulate both data (attributes) and behavior (methods), making it ideal for applications with complex data structures. The behavior of this model closely aligns with OOP principles, promoting better data reusability and modularity. A widely known example of an Object Database Management System (ODBMS) is MongoDB, which is also categorized under NoSQL databases. However, the object-oriented model is less mature and less widely adopted compared to the relational model, particularly in enterprise-level applications. Schema and Instances The overall design of a database is referred to as the database schema. It defines the logical structure of the database, including tables, relationships, views, indexes, and other elements. Unlike the actual data stored in the database, the schema serves as a blueprint and does not include the data itself. Database schemas are generally stable and do not change frequently, as they represent the foundational design of how data is organized and accessed. Types of Database Schema A database schema defines the structure, format, and organization of data in a database. It specifies how data is stored, what type of data is stored, and how different pieces of data relate to each other. While data may change frequently, the schema typically remains stable unless explicitly modified. There are three main types of database schemas: 1. Physical Schema Represents the physical storage of data on hardware (e.g., how data is stored in files, indexes, memory, etc.). It is hidden beneath the logical schema and can be modified without impacting application programs. Changes to the physical schema usually involve performance tuning or changes in storage structure. 2. Logical Schema Defines the logical structure of the database, such as tables, relationships, constraints, and data types. This is the level that programmers and database designers interact with when creating and modifying the database structure. Applications are built based on this schema. 3. External Schema (View Schema) Represents the view-level schema or how individual users or applications see the data. Different users can have customized views of the same data depending on their roles or access requirements. It is the highest level of abstraction, and multiple external schemas can exist for a single logical schema. Example A database schema for a person will have fields for name, email, phone and address as shown below − Student Name Email Contact Database Instance (Extension / Database State) A database instance refers to the collection of data stored in a database at a specific point in time. It represents the current state of the database and is also known as the extension or database state. Unlike the schema, which defines the structure of the database and remains relatively constant, the instance is dynamic—it changes frequently as data is added, updated, or deleted. Example A database instance for the Person database can be (User1,emai.com,11345679,addr) So the person construct will contain their individual entities in the attributes called as instance. This is shown below − Student Name Email Phone no Amit kpsd@yasd.com 2343435 John werwr@sdas.in 5345464 Riya wefrwer@sdf.com 2342342 Data Abstraction:Database systems, built on complex data structures, utilize abstraction to improve data retrieval efficiency and simplify user interactions. Abstraction works by hiding unnecessary details and presenting only relevant information, making the database easier to use and manage. This concept is fundamental in Database Management Systems (DBMS), where data abstraction shields end-users from the underlying complexities of data storage and processing. For example, when purchasing shoes online, a customer typically selects options such as brand, size, color, and material—while behind the scenes, intricate details like manufacturing processes, material sourcing, and production costs are hidden. This selective visibility helps users focus only on what’s important to them, enhancing usability and the overall experience. Levels of Data Abstraction in DBMS Data abstraction in DBMS is structured into three layers: Physical (Internal) Level Logical (Conceptual) Level View (External) Level Each layer plays a crucial role in managing data efficiently while shielding users from unnecessary complexity. Physical Level (Internal Level) The physical level, also known as the internal level, is the lowest layer of data abstraction in a DBMS. It deals with the actual storage of data on physical media such as hard drives. At this level, the complex data structures and access methods used to store and retrieve data are defined. Decisions about how data is organized and stored—such as indexing, file formats, and compression—are made by the database administrator (DBA). Example: When users interact with a database, they typically see data in the form of rows and columns, as in a relational table. However, at the physical level, these tables are stored as binary files on secure servers or data centers. The underlying structure and storage mechanisms are hidden from users, ensuring data is efficiently managed and securely maintained. Logical Level or Conceptual Level The logical (or conceptual) level defines the structure of data after it is extracted from the physical or internal level. It acts like a blueprint, organizing raw data into meaningful structures without considering how the end user will interact with it. Example: Suppose we have raw data about products (e.g., product ID, product name, manufacturing date) and customers (e.g., customer ID, customer name, address). At the logical level, this data would be organized into structured tables—such as a Products table and a Customers table. Relationships between these tables, such as which customer ordered which product, can also be defined using joins. View Level or External Level The view (or external) level is the highest level of data abstraction in a DBMS. It defines how data is presented to the end user. Instead of accessing the entire database, users see only the data relevant to their needs, typically based on queries made through the front-end. This data can be presented in various formats—such as tables, graphs, or pie charts. Different users can have different views of the same underlying data, tailored to their roles or requirements. Example: Referring to the earlier example, if a customer wants to view their order history, they will only see the list of products they have ordered. On the other hand, a shop owner might need to view a comprehensive table showing all ordered products along with the customer details for delivery purposes. Each user interacts with a specific "view" of the same data, without accessing the entire database. Conclusion Data abstraction in DBMS refers to the process of hiding the complex details of data storage and management from end users, making data access simpler and more secure. There are three levels of data abstraction in a DBMS: 1. Physical Level (Internal Level): This is the lowest level where raw data is stored in files on physical storage devices like hard drives. It deals with how data is actually saved in the system. 2. Logical Level (Conceptual Level): At this level, data from the physical layer is structured and organized into meaningful formats, such as tables, without revealing how the data is stored. 3. View Level (External Level): This is the highest level of abstraction. It presents data to end users based on their specific needs or queries. The same data can be represented in various formats, such as tables, graphs, or pie charts, offering different views to different users. This layered approach ensures efficient data management, user-friendly interaction, and enhanced security. Data Independence in DBMS Data independence refers to the ability to modify the database schema at one level without requiring changes at higher levels. This ensures that changes in how data is stored or structured do not impact how users or applications interact with the data. It is a key feature that simplifies database maintenance, supports system evolution, and promotes efficient data management. There are two main types of data independence: 1. Physical Data Independence: This allows changes to the internal (physical) schema—such as altering storage devices, file structures, or indexing methods—without affecting the conceptual schema or user views. For example, moving data to a new hard drive or optimizing storage will not impact how the data is logically organized or accessed by users. 2. Logical Data Independence: This allows modifications to the conceptual schema—such as adding new fields or relationships—without affecting the external schema or application programs. For instance, introducing a new column to a table should not require changes to user interfaces or queries that don’t use that column. Why It Matters: Data independence helps decouple application logic from data storage and structure. This flexibility makes the system easier to update, scale, and adapt over time without disrupting users or requiring costly rewrites of application code. How It Works Data independence is made possible by the three-schema architecture of a Database Management System (DBMS), which separates data into different abstraction levels. Each level serves a specific purpose and isolates changes from affecting the others unnecessarily. 1. External Level (View Level): This is the highest level, where individual users or applications interact with the database. It defines how users see the data, often limited to only what is relevant to them (e.g., specific tables, fields, or reports). 2. Conceptual Level (Logical Level): This middle level defines the overall logical structure of the database. It includes data models, relationships, and constraints, independent of how the data is physically stored. 3. Internal Level (Physical Level): This is the lowest level, concerned with the physical storage of data. It deals with file organization, indexing methods, storage devices, and other hardware-related details. How Data Independence Works: Physical Data Independence allows changes at the internal level (e.g., reorganizing files or changing storage hardware) without altering the conceptual level. Logical Data Independence allows changes at the conceptual level (e.g., adding new tables or attributes) without affecting the external level or application interfaces. This layered architecture ensures that any modification at a lower level is properly mapped to the next higher level, preserving consistency and preventing changes from cascading upward. As a result, users and applications remain unaffected by internal changes, making the system more robust and easier to maintain. Types of Data Independence Physical Data Independence What it is: Physical data independence is the ability to modify the internal schema—which defines how data is physically stored—without affecting the conceptual schema or external views. This means changes in storage methods or hardware do not impact how the data is logically structured or how users access it. Examples: Switching from HDDs to SSDs for faster data access. Changing the indexing strategy to improve query performance. Implementing data compression techniques to save storage space. Benefit: Physical data independence enables backend storage optimizations and hardware upgrades without requiring changes to applications or user interactions, ensuring flexibility and system efficiency. Here’s a refined and structured version of your explanation for Logical Data Independence: Logical Data Independence What it is: Logical data independence is the ability to modify the conceptual schema—which defines the logical structure of the database—without impacting the external schemas or application programs. This means changes to the data model do not require rewriting application logic or altering user interfaces. Examples: Adding a new column (e.g., an email field) to a customer table without affecting existing applications that only access the name and address fields. Creating a new relationship between tables without changing existing queries that don’t rely on it. Benefit: Logical data independence allows the database structure to evolve over time—such as adding new fields, tables, or relationships—without disrupting existing applications. This ensures long-term maintainability and adaptability of the system. Overall Database Architecture:The architecture of a DBMS is typically layered as follows: Top Layer: This layer includes various application interfaces that serve different types of users: Naive users who interact through simple interfaces Application programs developed by programmers Query tools for sophisticated users who run complex queries Administration tools used by database administrators for managing the system Middle Layers: These layers contain the core components of the DBMS: Query Processor: Interprets and executes database queries Storage Manager: Handles the efficient storage, retrieval, and updating of data Bottom Layer: This is the disk storage layer, where the actual data is physically stored on hardware devices. Together, these layers work to provide efficient, secure, and user-friendly access to relational data stored in the database.
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )