


































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



































Introduction Database Management System What is a Database? A database is a collection of related data which represents some aspect of the real world. A database system is designed to be built and populated with data for a certain task. What is DBMS? Database Management System (DBMS) is a software for storing and retrieving users’ data while considering appropriate security measures. It consists of a group of programs which manipulate the database. The DBMS accepts the request for data from an application and instructs the operating system to provide the specific data. In large systems, a DBMS helps users and other third-party software to store and retrieve data. DBMS allows users to create their own databases as per their requirement. The term “DBMS” includes the user of the database and other application programs. It provides an interface between the data and the software application. Example of a DBMS Let us see a simple example of a university database. This database is maintaining information concerning students, courses, and grades in a university environment. The database is organized as five files: The STUDENT file stores data of each student The COURSE file stores contain data on each course. The SECTION stores the information about sections in a particular course. The GRADE file stores the grades which students receive in the various sections The TUTOR file contains information about each professor. To define DBMS: We need to specify the structure of the records of each file by defining the different types of data elements to be stored in each record. We can also use a coding scheme to represent the values of a data item. Basically, your Database will have 5 tables with a foreign key defined amongst the various tables. History of DBMS Here, are the important landmarks from the history: 1960 – Charles Bachman designed first DBMS system 1970 – Codd introduced IBM’S Information Management System (IMS) 1976- Peter Chen coined and defined the Entity-relationship model also know as the ER model 1980 – Relational Model becomes a widely accepted database component 1985- Object-oriented DBMS develops. 1990s- Incorporation of object-orientation in relational DBMS.
1991- Microsoft ships MS access, a personal DBMS and that displaces all other personal DBMS products. 1995: First Internet database applications 1997: XML applied to database processing. Many vendors begin to integrate XML into DBMS products. Characteristics of DBMS Here are the characteristics and properties of Database Management System: Provides security and removes redundancy Self-describing nature of a database system Insulation between programs and data abstraction Support of multiple views of the data Sharing of data and multiuser transaction processing Database Management Software allows entities and relations among them to form tables. It follows the ACID concept (Atomicity, Consistency, Isolation, and Durability). DBMS supports multi-user environment that allows users to access and manipulate data in parallel. What is a File system? A file system is a technique of arranging the files in a storage medium like a hard disk, pen drive, DVD, etc. It helps you to organizes the data and allows easy retrieval of files when they are required. It mostly consists of different types of files like mp3, mp4, txt, doc, etc. that are grouped into directories. A file system enables you to handle the way of reading and writing data to the storage medium. It is directly installed into the computer with the Operating systems such as Windows and Linux. KEY DIFFERENCES: A file system is a software that manages and organizes the files in a storage medium, whereas 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, 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 DBMS provides a concurrency facility.
Application of DBMS Below are the popular database system applications: Sector Use of DBMS Banking For customer information, account activities, payments, deposits, loans, etc. Airlines For reservations and schedule information. Universities For student information, course registrations, colleges and grades. Telecommunication It helps to keep call records, monthly bills, maintaining balances, etc. Finance For storing information about stock, sales, and purchases of financial instruments like stocks and bonds. Sales Use for storing customer, product & sales information. Manufacturing It is used for the management of supply chain and for tracking production of items. Inventories status in warehouses. HR Management For information about employees, salaries, payroll, deduction, generation of paychecks, etc. Types of DBMS Typ es of DBMS The main Four Types of Database Management System are: Hierarchical database Network database
Relational database Object-Oriented database Hierarchical DBMS Model In a Hierarchical database, model data is organized in a tree-like structure. Data is Stored Hierarchically (top down or bottom up) format. Data is represented using a parent-child relationship. In Hierarchical DBMS parent may have many children, but children have only one parent. Network Model The network database model allows each child to have multiple parents. It helps you to address the need to model more complex relationships like as the orders/parts many-to-many relationship. In this model, entities are organized in a graph which can be accessed through several paths. Relational Model Relational DBMS is the most widely used DBMS model because it is one of the easiest. This model is based on normalizing data in the rows and columns of the tables. Relational model stored in fixed structures and manipulated using SQL. Object-Oriented Model In Object-oriented Model data stored in the form of objects. The structure which is called classes which display data within it. It is one of the components of DBMS that defines a database as a collection of objects which stores both data members values and operations. Advantages of DBMS DBMS offers a variety of techniques to store & retrieve data DBMS serves as an efficient handler to balance the needs of multiple applications using the same data Uniform administration procedures for data Application programmers never exposed to details of data representation and storage. A DBMS uses various powerful functions to store and retrieve data efficiently. Offers Data Integrity and Security The DBMS implies integrity constraints to get a high level of protection against prohibited access to data. A DBMS schedules concurrent access to the data in such a manner that only one user can access the same data at a time Reduced Application Development Time Disadvantage of DBMS DBMS may offer plenty of advantages but, it has certain flaws-
file, records and fields
Relational Integrity Constraints Relational Integrity constraints in DBMS are referred to conditions which must be present for a valid relation. These Relational constraints in DBMS are derived from the rules in the mini- world that the database represents. There are many types of Integrity Constraints in DBMS. Constraints on the Relational database management system is mostly divided into three main categories are:
Select allows you to choose a specific range of data. Whenever one of these operations are applied, integrity constraints specified on the relational database schema must never be violated. Insert Operation The insert operation gives values of the attribute for a new tuple which should be inserted into a relation. Update Operation You can see that in the below-given relation table CustomerName= ‘Apple’ is updated from Inactive to Active. Delete Operation To specify deletion, a condition on the attributes of the relation selects the tuple to be deleted. In the above-given example, CustomerName= “Apple” is deleted from the table. The Delete operation could violate referential integrity if the tuple which is deleted is referenced by foreign keys from other tuples in the same database.
Select Operation In the above-given example, CustomerName= “Amazon” is selected Best Practices for creating a Relational Model Data need to be represented as a collection of relations Each relation should be depicted clearly in the table Rows should contain data about instances of an entity Columns must contain data about attributes of the entity Cells of the table should hold a single value Each column should be given a unique name No two rows can be identical The values of an attribute should be from the same domain Advantages of Relational Database Model Simplicity : A Relational data model in DBMS is simpler than the hierarchical and network model. Structural Independence : The relational database is only concerned with data and not with a structure. This can improve the performance of the model. Easy to use : The Relational model in DBMS is easy as tables consisting of rows and columns are quite natural and simple to understand Query capability : It makes possible for a high-level query language like SQL to avoid complex database navigation. Data independence : The Structure of Relational database can be changed without having to change any application. Scalable : Regarding a number of records, or rows, and the number of fields, a database should be enlarged to enhance its usability. Disadvantages of Relational Model Few relational databases have limits on field lengths which can’t be exceeded. Relational databases can sometimes become complex as the amount of data grows, and the relations between pieces of data become more complicated. Complex relational database systems may lead to isolated databases where the information cannot be shared from one system to another.
Entity Relationship Diagram Example What is ER Model? ER Model stands for Entity Relationship Model is a high-level conceptual data model diagram. ER model helps to systematically analyze data requirements to produce a well-designed database. The ER Model represents real-world entities and the relationships between them. Creating an ER Model in DBMS is considered as a best practice before implementing your database. ER Modeling helps you to analyze data requirements systematically to produce a well-designed database. So, it is considered a best practice to complete ER modeling before implementing your database. History of ER models ER diagrams are visual tools that are helpful to represent the ER model. Peter Chen proposed ER Diagram in 1971 to create a uniform convention that can be used for relational databases and networks. He aimed to use an ER model as a conceptual modeling approach.
Why use ER Diagrams? Here, are prime reasons for using the ER Diagram Helps you to define terms related to entity relationship modeling Provide a preview of how all your tables should connect, what fields are going to be on each table Helps to describe entities, attributes, relationships ER diagrams are translatable into relational tables which allows you to build databases quickly ER diagrams can be used by database designers as a blueprint for implementing data in specific software applications The database designer gains a better understanding of the information to be contained in the database with the help of ERP diagram ERD Diagram allows you to communicate with the logical structure of the database to users Facts about ER Diagram Model Now in this ERD Diagram lesson, let’s check out some interesting facts about ER Diagram Model: ER model allows you to draw Database Design It is an easy to use graphical tool for modeling data Widely used in Database Design It is a GUI representation of the logical structure of a Database It helps you to identifies the entities which exist in a system and the relationships between those entities ER Diagrams Symbols & Notations Entity Relationship Diagram Symbols & Notations mainly contains three basic symbols which are rectangle, oval and diamond to represent relationships between elements, entities and attributes. There are some sub-elements which are based on main elements in ERD Diagram. ER Diagram is a visual representation of data that describes how data is related to each other using different ERD Symbols and Notations. Following are the main components and its symbols in ER Diagrams: Rectangles: This Entity Relationship Diagram symbol represents entity types Ellipses : Symbol represent attributes Diamonds: This symbol represents relationship types Lines: It links attributes to entity types and entity types with other relationship types Primary key: attributes are underlined Double Ellipses: Represent multi-valued attributes
A real-world thing either living or non-living that is easily recognizable and nonrecognizable. It is anything in the enterprise that is to be represented in our database. It may be a physical thing or simply a fact about the enterprise or an event that happens in the real world. An entity can be place, person, object, event or a concept, which stores data in the database. The characteristics of entities are must have an attribute, and a unique key. Every entity is made up of some ‘attributes’ which represent that entity. Examples of entities: Person: Employee, Student, Patient Place: Store, Building Object: Machine, product, and Car Event: Sale, Registration, Renewal Concept: Account, Course Notation of an Entity Entity set: Student An entity set is a group of similar kind of entities. It may contain entities with attribute sharing similar values. Entities are represented by their properties, which also called attributes. All attributes have their separate values. For example, a student entity may have a name, age, class, as attributes. Example of Entities: A university may have some departments. All these departments employ various lecturers and offer several programs. Some courses make up each program. Students register in a particular program and enroll in various courses. A lecturer from the specific department takes each course, and each lecturer teaches a various group of students.
Relationship Relationship is nothing but an association among two or more entities. E.g., Tom works in the Chemistry department. Entities take part in relationships. We can often identify relationships with verbs or verb phrases. For example: You are attending this lecture I am giving the lecture Just loke entities, we can classify relationships according to relationship-types: A student attends a lecture A lecturer is giving a lecture. Weak Entities A weak entity is a type of entity which doesn’t have its key attribute. It can be identified uniquely by considering the primary key of another entity. For that, weak entity sets need to have participation. In above ER Diagram examples, “Trans No” is a discriminator within a group of transactions in an ATM. Let’s learn more about a weak entity by comparing it with a Strong Entity Strong Entity Set Weak Entity Set
Simple attribute Simple attributes can’t be divided any further. For example, a student’s contact number. It is also called an atomic value. Composite attribute It is possible to break down composite attribute. For example, a student’s full name may be further divided into first name, second name, and last name. Derived attribute This type of attribute does not include in the physical database. However, their values are derived from other attributes present in the database. For example, age should not be stored directly. Instead, it should be derived from the DOB of that employee. Multivalued attribute Multivalued attributes can have more than one values. For example, a student can have more than one mobile number, email address, etc. Cardinality Defines the numerical attributes of the relationship between two entities or entity sets. Different types of cardinal relationships are: One-to-One Relationships One-to-Many Relationships May to One Relationships Many-to-Many Relationships 1.One-to-one: One entity from entity set X can be associated with at most one entity of entity set Y and vice versa.
Example: One student can register for numerous courses. However, all those courses have a single line back to that one student. 2.One-to-many: One entity from entity set X can be associated with multiple entities of entity set Y, but an entity from entity set Y can be associated with at least one entity. For example, one class is consisting of multiple students.
3. Many to One More than one entity from entity set X can be associated with at most one entity of entity set Y. However, an entity from entity set Y may or may not be associated with more than one entity from entity set X. For example, many students belong to the same class.