ISO 9001:2008 CERTIFIEDAdvantages of Relational Algebra 9.3. Limitations of Relational Algebra...
Transcript of ISO 9001:2008 CERTIFIEDAdvantages of Relational Algebra 9.3. Limitations of Relational Algebra...
ISO 9001:2008 CERTIFIED
DATABASEMANAGEMENT SYSTEM
V. RajyalakshmiM.Sc. (Maths), MCA, M.Tech.
HOD, Dept. of Computer Science,BVK College, Visakhapatnam.
B. SatishMCA
HOD, Dept. of Computer Science,Aditya Degree College,
Gopalapatnam, Visakhapatnam.
Dr. O. Naga RajuHOD, Dept. of Computer Science,
Govt. Degree College,Macherla, Guntur.
(As per new CBCS Syllabus for Fifth SemesterB.Sc. Computer Science/Information Technology (IT) and
B.Com. (Computer Applications) ofAll Universities in Andhra Pradesh w.e.f. 2015-16)
Published by : Mrs. Meena Pandey for Himalaya Publishing House Pvt. Ltd.,“Ramdoot”, Dr. Bhalerao Marg, Girgaon, Mumbai - 400 004.Phone: 022-23860170/23863863, Fax: 022-23877178E-mail: [email protected]; Website: www.himpub.com
Branch Offices :
New Delhi : “Pooja Apartments”, 4-B, Murari Lal Street, Ansari Road, Darya Ganj,New Delhi - 110 002. Phon e: 011-23270392, 23278631; Fax: 011-23256286
Nagpur : Kundanlal Chandak Industrial Estate, Ghat Road, Nagpur - 440 018.Phone: 0712-2738731, 3296733; Telefax: 0712-2721216
Bengaluru : Plot No. 91-33, 2nd Main Road Seshadripuram, Behind Nataraja Theatre,Bengaluru-560020. Phone: 08041138821, 9379847017, 9379847005
Hyderabad : No. 3-4-184, Lingampally, Besides Raghavendra Swamy Matham,Kachiguda, Hyderabad - 500 027. Phone: 040-27560041, 27550139
Chennai : New-20, Old-59, Thirumalai Pillai Road, T. Nagar, Chennai - 600 017.Mobile: 9380460419
Pune : First Floor, “Laksha” Apartment, No. 527, Mehunpura, Shaniwarpeth(Near Prabhat Theatre), Pune - 411 030.Phone: 020-24496323/24496333; Mobile: 09370579333
Lucknow : House No 731, Shekhupura Colony, Near B.D. Convent School, Aliganj,Lucknow - 226 022. Phone: 0522-4012353; Mobile: 09307501549
Ahmedabad : 114, “SHAIL”, 1st Floor, Opp. Madhu Sudan House, C.G. Road,Navrang Pura, Ahmedabad - 380 009.Phone: 079-26560126; Mobile: 09377088847
Ernakulam : 39/176 (New No: 60/251) 1st Floor, Karikkamuri Road, Ernakulam,Kochi – 682011. Phone: 0484-2378012, 2378016 Mobile: 09387122121
Bhubaneswar : 5 Station Square, Bhubaneswar - 751 001 (Odisha).Phone: 0674-2532129, Mobile: 09338746007
Kolkata : 108/4, Beliaghata Main Road, Near ID Hospital, Opp. SBI Bank,Kolkata - 700 010, Phone: 033-32449649, Mobile: 7439040301
DTP by : Prerana Enterprises, Mumbai.
Printed at : M/s. Aditya Offset Process (I) Pvt. Ltd., Hyderabad. On behalf of HPH.
© AuthorsNo part of this publication may be reproduced, stored in a retrieval system, or transmitted in anyform or by any means, electronic, mechanical, photocopying, recording and/or otherwise withoutthe prior written permission of the publisher.
First Edition : 2017
PREFACE
DBMS plays a major role in many organizations. This book is mainly designedto cover the new syllabus of T.Y. B.Sc. and T.Y. B.Com., Semester V, i.e., DBMS.Apart from that, it is also useful for Engineering students as well.
This book covers Overview of DBMS, File-based systems, ER Model, RelationalModel, SQL, and PL/SQL.
This book is drafted to facilitate easy understanding of DBMS with clear andsimple examples. SQL and PL/SQL examples can be practiced by students in theirrespective labs.
Constructive suggestions are welcome from faculty and students for furtherimprovement of this book.
AuthorsAuthorsAuthorsAuthorsAuthors
SYLLABUSAndhra Pradesh State Council of Higher EducationAndhra Pradesh State Council of Higher EducationAndhra Pradesh State Council of Higher EducationAndhra Pradesh State Council of Higher EducationAndhra Pradesh State Council of Higher Education
B.Sc. Computer Science/Information Technology (IT)B.Sc. Computer Science/Information Technology (IT)B.Sc. Computer Science/Information Technology (IT)B.Sc. Computer Science/Information Technology (IT)B.Sc. Computer Science/Information Technology (IT)III YEAR V SEMESTERIII YEAR V SEMESTERIII YEAR V SEMESTERIII YEAR V SEMESTERIII YEAR V SEMESTER
Paper-V: Database Management SystemPaper-V: Database Management SystemPaper-V: Database Management SystemPaper-V: Database Management SystemPaper-V: Database Management System
Course ObjectiveCourse ObjectiveCourse ObjectiveCourse ObjectiveCourse ObjectiveDesign and develop database for large volumes and varieties of data with
optimized data processing techniques.
Course OutcomesCourse OutcomesCourse OutcomesCourse OutcomesCourse OutcomesOn completing the subject, students will be able to: 1. Design and model of
data in database. 2. Store and retrieve data in database.
UNIT IUNIT IUNIT IUNIT IUNIT IOverview of Database Management System: Overview of Database Management System: Overview of Database Management System: Overview of Database Management System: Overview of Database Management System: Introduction, File-based
system, Drawbacks of File-based System Data and Information, Database, DatabaseManagement System, Objectives of DBMS, Evaluation of Database managementSystem, Classification of Database Management System, DBMS Approach, Advantagesof DBMS, Anis/Spark Data Model, Data Models, Components and Interfaces ofDatabase Management System. Database Architecture, Situations where DBMS isnot necessary, DBMS Vendors and their products.
UNIT IIUNIT IIUNIT IIUNIT IIUNIT IIEntity Relationship Model: Entity Relationship Model: Entity Relationship Model: Entity Relationship Model: Entity Relationship Model: Introduction, the building blocks of an entity
relationship diagram, classification of entity sets, attribute classification, relationshipdegree, relationship classification, reducing ER diagram to tables, enhanced entityrelationship model (EER model), generalization and specialization, IS A relationshipand attribute inheritance, multiple inheritance, constraints on specialization andgeneralization, aggregation and composition, entity clusters, connection types,advantages of FR modeling.
UNIT IIIUNIT IIIUNIT IIIUNIT IIIUNIT IIIRelational Model: Relational Model: Relational Model: Relational Model: Relational Model: Introduction, CODD Rules, relational data model, concept
of key, relational integrity, relational algebra, relational algebra operations, advantagesof relational algebra, limitations of relational algebra, relational calculus, tuplerelational calculus, domain relational calculus (DRC) and QBE.
UNIT IVUNIT IVUNIT IVUNIT IVUNIT IVStructured Query Language: Structured Query Language: Structured Query Language: Structured Query Language: Structured Query Language: Introduction, History of SQL Standard, Commands
in SQL, Data Types in SQL, Data Definition Language, Selection Operation, ProjectionOperation, Aggregate functions, Data Manipulation Language, Table ModificationCommands, Table Truncation, Imposition of Constraints, Join Operation, Set Operation,View, Sub Query, Embedded SQL.
UNIT VUNIT VUNIT VUNIT VUNIT VPL/SQL: PL/SQL: PL/SQL: PL/SQL: PL/SQL: Introduction, Shortcomings in SQL, Structure of PL/SQL, PL/SQL
Language Elements, Data Types, Operators, Precedence, Control Structure, Steps toCreate a PL/SQL Program, Iterative Control, Cursors, Steps to create a Cursors,Procedure, Function, Packages, Exceptions Handling, Database Triggers, Types ofTriggers.
Student Activity:Student Activity:Student Activity:Student Activity:Student Activity:1.1.1.1.1. Create your college database for placement purpose.Create your college database for placement purpose.Create your college database for placement purpose.Create your college database for placement purpose.Create your college database for placement purpose.2.2.2.2.2. Create faculty database of your college with their academicCreate faculty database of your college with their academicCreate faculty database of your college with their academicCreate faculty database of your college with their academicCreate faculty database of your college with their academic
performance scores.performance scores.performance scores.performance scores.performance scores.
KRISHNA UNIVERSITYKRISHNA UNIVERSITYKRISHNA UNIVERSITYKRISHNA UNIVERSITYKRISHNA UNIVERSITYMACHILIPATNAMMACHILIPATNAMMACHILIPATNAMMACHILIPATNAMMACHILIPATNAMCourse StructureCourse StructureCourse StructureCourse StructureCourse Structure
B.Com. (Computer Applications)B.Com. (Computer Applications)B.Com. (Computer Applications)B.Com. (Computer Applications)B.Com. (Computer Applications)
DSC 2F 5.6 – Database Management SystemDSC 2F 5.6 – Database Management SystemDSC 2F 5.6 – Database Management SystemDSC 2F 5.6 – Database Management SystemDSC 2F 5.6 – Database Management System
UNIT IUNIT IUNIT IUNIT IUNIT IOverview of Database Management System: Overview of Database Management System: Overview of Database Management System: Overview of Database Management System: Overview of Database Management System: Introduction, Data and
Information, Database, Database Management System, Objectives of DBMS, Evolutionof Database Management Systems, Classification of Database Management System.
UNIT IIUNIT IIUNIT IIUNIT IIUNIT IIFile-based System, Drawbacks of File-based System, DBMS Approach, Advantages
of DBMS, Data Models, Components of Database System, Database Architecture,DBMS Vendors and their Products.
UNIT IIIUNIT IIIUNIT IIIUNIT IIIUNIT IIIEntity Relationship Model: Entity Relationship Model: Entity Relationship Model: Entity Relationship Model: Entity Relationship Model: Introduction, The Building Blocks of an Entity
Relationship, Classification of Entity Sets, Attribute Classification, Relationship Degree,Relationship Classification, Generalization and Specialization, Aggregation andComposition, CODD’s Rules, Relational Data Model, Concept of Relational Integrity.
Unit IVUnit IVUnit IVUnit IVUnit IVStructured Query Language: Structured Query Language: Structured Query Language: Structured Query Language: Structured Query Language: Introduction, History of SQL Standard, Commands
in SQL, Data Types in SQL, Data Definition Language (DDL), Selection OperationProjection Operation, Aggregate Functions, Data Manipulation Language, TableModification, Table Truncation, Imposition of Constraints, Set Operations.
Unit VUnit VUnit VUnit VUnit VPL/SQL: PL/SQL: PL/SQL: PL/SQL: PL/SQL: Introduction, Structure of PL/SQL, PL/SQL Language Elements Data
Types, Control Structure,, Steps to Create a PL/SQL Program, Iterative ControlCursors, Steps to Create a Cursor, Procedure, Function, Packages, Exceptions Handling,Database Triggers, Types of Triggers.
CONTENTS
UNIT IUNIT IUNIT IUNIT IUNIT I1 .1 .1 .1 .1 . Fundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management System 1-51 -51 -51 -51 -5
1.1. Introduction1.2. File-based System1.3. Drawbacks of File-based System1.4. Data and Information1.5. Database
2 .2 .2 .2 .2 . Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System 6-106-106-106-106-102.1. Objectives of DBMS2.2. Evaluation of DBMS2.3. Classification of DBMS2.4. DBMS Approach2.5. Advantages of DBMS
3 .3 .3 .3 .3 . Data ModelData ModelData ModelData ModelData Model 11-1711-1711-1711-1711-173.1. ANSI/SPARC Data Model3.2. Data Model Basic Building Blocks3.3. Types of Relationships3.4. Types of Data Models
4 .4 .4 .4 .4 . Components and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management System 18-2218-2218-2218-2218-224.1. Classification of DBMS Users4.2. Database Administrator4.3. Structure of DBMS
4.3.1. Storage Manager4.3.2. Query Processor
4.4. Application Architecture4.5. Situations where DBMS is Not Necessary
5 .5 .5 .5 .5 . DBMS Vendors and their ProductsDBMS Vendors and their ProductsDBMS Vendors and their ProductsDBMS Vendors and their ProductsDBMS Vendors and their Products 23-2523-2523-2523-2523-25
UNIT IIUNIT IIUNIT IIUNIT IIUNIT II6 .6 .6 .6 .6 . Entity Relationship ModelEntity Relationship ModelEntity Relationship ModelEntity Relationship ModelEntity Relationship Model 26-3726-3726-3726-3726-37
6.1. Introduction6.2. The Building Block of an Entity Relationship Diagram6.3. Classification of Entity Sets6.4. Attribute Classification6.5. Relationship Degree6.6. Relationship Classification6.7. ER Diagrams
7 .7 .7 .7 .7 . Enhanced Entity Relationship ModelEnhanced Entity Relationship ModelEnhanced Entity Relationship ModelEnhanced Entity Relationship ModelEnhanced Entity Relationship Model 38-4638-4638-4638-4638-467.1. Enhanced Entity Relationship Model7.2. Generalization and Specialization7.3. IS-A Relationship and Attribute Inheritance7.4. Multiple Inheritance7.5. Constraints on Specialization and Generalization7.6. Aggregation and Composition7.7. Entity Clusters7.8. Connection Traps7.9. Advantages of ER Modeling
UNIT IIIUNIT IIIUNIT IIIUNIT IIIUNIT III8 .8 .8 .8 .8 . Relational ModelRelational ModelRelational ModelRelational ModelRelational Model 47-5247-5247-5247-5247-52
8.1. Introduction8.2. CODD’s Rules8.3. Relational Data Model8.4. Concept of Key8.5. Types of Keys8.6. Relational Integrity
9 .9 .9 .9 .9 . Relational AlgebraRelational AlgebraRelational AlgebraRelational AlgebraRelational Algebra 53-5653-5653-5653-5653-569.1. Relational Algebra Operations9.2. Advantages of Relational Algebra9.3. Limitations of Relational Algebra
10 .10 .10 .10 .10 . Relational CalculusRelational CalculusRelational CalculusRelational CalculusRelational Calculus 57-6457-6457-6457-64
UNIT IVUNIT IVUNIT IVUNIT IVUNIT IV11 .11 .11 .11 .11 . Structured Query LanguageStructured Query LanguageStructured Query LanguageStructured Query LanguageStructured Query Language 65-8265-8265-8265-82
11.8.1. DML Commands11.8.2. Table Manipulation Commands11.8.3. Table Truncation
65-8211.1. History of SQL Standard11.2. Commands in SQL11.3. Datatypes in SQL11.4. Data Definition Language11.5. Selection Operation11.6. Projection Operation11.7. Aggregate Function11.8. Data Manipulation Language
57-6410.1. Relational Calculus10.2. Tuple Relational Calculus10.3. Domain Relational Calculus10.4. QBE
11.9. Imposition of Constraintts11.10. JOIN Operation11.11. SET Operation11.12. View11.13. Subquery11.14. Embedded SQL
UNIT VUNIT VUNIT VUNIT VUNIT V12 .12 .12 .12 .12 . PL/SQLPL/SQLPL/SQLPL/SQLPL/SQL 83-9383-9383-9383-9383-93
12.1. Introduction12.2. Shortcomings in SQL12.3. Structure of PL/SQL12.4. PL/SQL Language Elements12.5. Datatypes12.6. Operator Precedence12.7. Control Structure12.8. Steps to Create PL/SQL program
13 .13 .13 .13 .13 . Cursors Cursors Cursors Cursors Cursors 94-9894-9894-9894-9894-9813.1. Cursor Attributes13.2. Steps to Create Cursor
14 .14 .14 .14 .14 . ProceduresProceduresProceduresProceduresProcedures 99-10299-10299-10299-10299-10214.1. Benefits of Procedures and Functions14.2. Defining and Creating Procedures14.3. Executing a Procedure14.4. Deleting Procedure14.5. Functions
15 .15 .15 .15 .15 . PackagesPackagesPackagesPackagesPackages 103-104103-104103-104103-104103-10415.1. Advantages of Packages15.2. Creating a Package15.3. Removing a Package
16 .16 .16 .16 .16 . Exceptions HandlingExceptions HandlingExceptions HandlingExceptions HandlingExceptions Handling 105-106105-106105-106105-106105-10616.1. Advantages of Exception16.2. Exception Types
17 .17 .17 .17 .17 . TriggersTriggersTriggersTriggersTriggers 107-110107-110107-110107-110107-11017.1. Uses of Database Triggers17.2. Context to Use Triggers17.3. Parts of a Trigger17.4. Types of Triggers17.5. Replacing Triggers17.6. Dropping Triggers
Bibl iographyBibl iographyBibl iographyBibl iographyBibl iography 111111111111111
1
INTRODUCTION
A Database Management System (DBMS) is a collection of interrelated data and a setof programs to access those data. The collection of data, usually referred to as thedatabase, contains information relevant to an enterprise.
A Database Management System (DBMS) is a software system that allows access todata contained in a database. DBMS provides a convenient and effective method of defining,storing, and retrieving the information contained in the database.
Management data involves both defining structures for storage of information andproviding mechanisms for the manipulation of information.
Some applications of Database Management Systems are
Banking:Banking:Banking:Banking:Banking: for customer information, accounts, and loans, and banking transactions
Airlines:Airlines:Airlines:Airlines:Airlines: for reservations and schedule information
Universities:Universities:Universities:Universities:Universities: for student information, course registrations and grades
Corporate record keeping: Corporate record keeping: Corporate record keeping: Corporate record keeping: Corporate record keeping: employment and tax records, inventories, sales recordsetc.
Sales: Sales: Sales: Sales: Sales: for customer, product and purchase information
FILE-BASED SYSTEM
File-based systems store data over a long period of time, and they allow the storageof large amounts of data. The file-based system is supported by a conventional operatingsystem. The system stores permanent records in various files, and it needs differentapplication programs to extract records from, and add records to, the appropriate files.
1.1
1.2
UNIT - I
Fundamentals ofFundamentals ofFundamentals ofFundamentals ofFundamentals ofDatabaseDatabaseDatabaseDatabaseDatabase
Management SystemManagement SystemManagement SystemManagement SystemManagement System1
22222 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
Before database management systems (DBMS) came along, organizations usually storedinformation in such systems. In this system, files containing records have no structuredrelationship among them.
Characteristics of File-based System
Some important characteristics are:
It is a group of files storing data of an organization.
Each is independent from one another.
Files are designed by using programs written in programming languages such asCoBOL, C and C++.
The physical implementation and access procedures are written into databaseapplication: therefore, physical changes resulted in intensive rework on the partof the programmer.
As systems became more complex, file processing systems offered little flexibility,presented.
DRAWBACKS OF THE FILE-BASED SYSTEM
Using the file-based system to keep organizational information has number ofdisadvantages:
Data RedundancyRedundancy means having multiple copies of the same data. In file-based systems,
each application program has its own data files. The same data may be duplicated in morethan one file. The duplication of data may create many problems such as:
To update a specific data/record, the same data must be updated in all files,otherwise different files may have different information about a specific item.
Storage is wasted.
Data Inconsistency
Data inconsistency means that different files may contain different information of aparticular object or person. Redundancy leads to inconsistency. When the same data isstored in multiple locations, the inconsistency may occur.
Data IsolationIn file-based system, data is isolated in separate files. It is difficult to update and to
access particular information from data files.
Data Dependence
The data stored in file depends upon the application program through which the filewas created. It means that the structure of data files is coupled with application program.
1.3
1.4
It is difficult to change the structure of data files or records. If you want to change thestructure of data file, then you have to modify the application program.
Program Maintenance
In file-based systems, the structure of data file is coupled with the individual applicationprograms. Therefore, any modifications to a data file such as size of a data field, its typeetc. requires the modification of the application program also. This process of modifyingthe program is referred to as program maintenance.
Data SharingIn file-based system, each application program uses its own private data files. The
file-based system do not provide the facility to share data of a data file among multipleusers on the network.
Data Security
In the computer file-based system, each application program uses its own privatedata files. Anyone can easily change or delete valuable data stored in the data file.
Incompatible File Format
In computer file-based processing systems, the structure of data file is coupled withthe application program and the structure of data file is dependent on the programminglanguages in which the application program was developed.
Lack of Atomicity
If there is any failure to insert, update or delete in the file system, there is nomechanism to switch back to the previous state. Atomicity refers to completion of wholetransaction or not completing it at all. Partial completion of any transaction leads toincorrect data in the system. File system does not guarantee the atomicity.
DATA AND INFORMATION
Data
Data is raw, unorganized facts that need to be processed. Data can be somethingsimple and useless unless until it is organized.
Ex: marks in different subjects of a student
Information
When data is processed, organized, structured or presented in a given context so asto make it useful, it is called information.
Ex: total marks, average marks can be derived from the given marks, i.e., data
Fundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management System 33333
44444 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
1.5 DATABASE
A database is a shared collection of related information stored so that it is availableto many users for different purpose. A database is a computer-based record keepingsystem whose overall purpose is to record and maintain information. The content ofdatabase is obtained by combining data from all the different sources in an organizationso that data are available to all users and redundant data can be eliminated or at leastminimized. Some of the common database applications are student database system,business inventory, accounting information, organization data, etc. A major purpose of adatabase system is to provide users with an abstract view of the data. That is, the systemhides certain details of how the data are stored and maintained.
Database Elements
Tables: Tables: Tables: Tables: Tables: A database table is composed of records and fields that hold data. Tablesare also called data sheets. Each table in a database holds data about different,but related subject.
Records:Records:Records:Records:Records: Data is stored in records. A record is composed of fields and contains allthe data about one particular person, company, or item in a database. A recordappears as row in the database table.
Field:Field:Field:Field:Field: A field is part of a record and contains a single piece of data for the subjectof the record.
Student Table
Roll Number Student Name CGPA
111 AJAY 7.6
222 VINOD 8.3
Data Abstraction
Since many database-systems users are not computer trained, developers hide thecomplexity from users through several levels of abstraction, to simplify users’ interactionswith the system:
Physical level: the lowest level of abstraction describes how the data are actuallystored. The physical level describes complex low-level data structures in detail.
Logical level: the next-higher level of abstraction describes what data are storedin the data, and what relationships exist among those data. The logical level thusdescribes the entire database in terms of a small number of relatively simplestructures. Although implementation of the simple structures at the logical levelmay involve complex physical-level structures, the user of logical level does not
Rows or records
Columns or Fields
need to be aware of complexity. Database administrators, who must decide whatinformation to keep in the database, use the logical level of abstraction.
View level: the highest level of abstraction describes only part of the entiredatabase. Even though the logical level uses simpler structures, complexity remainsbecause of the variety of information stored in a large database. May users ofthe database system do not need all this information; instead, they need toaccess only a part of the database. The view level of abstraction exists to simplifytheir interaction with the system. The system may provide many views for thesame database.
Instances and SchemasDatabases change over time as information is inserted and deleted. The collection of
information stored in the database at a particular moment is called an instance of thedatabase. The overall design of the database is called the database schema.
Database systems have several schemas, partitioned according to the levels ofabstraction. The physical schema describes the database design at the physical level,while the logical schema describes the database design at the logical level. A databasemay also have several schemas at the view level, sometimes call ‘subschema’ that describedifferent views of the database.
Data DictionaryIt holds detailed information about the different structures and data types, the details
of the logical structures that are mapped into the different structure, details of relationshipbetween data items, details of all users privileges and access rights and performance ofresource with details.
Fundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management SystemFundamentals of Database Management System 55555
2.2
2.1 OBJECTIVE OF DATABASE MANAGEMENT SYSTEM
A DBMS is a powerful tool for creating and managing large amounts of data efficientlyand allowing it to persist over long periods of time, safely. These systems are among themost complex types of software available.
The database management system (DBMS) is a software system that allows accessto data contained in a database. The objective of the DBMS is to provide a convenientand effective method of defining, soring, and retrieving the information contained in thedatabase. The DBMS interfaces with application programs, so that the data contained inthe database can be used by multiple applications and users.
Database systems are designed to manage large bodies of information. Managementof data involves both defining structures for large storage of information and providingmechanisms for manipulation of information. In addition, the database system must ensurethe safety of the information stored, despite system crashes or attempts at unauthorizedaccess. If data are to be shared among several users the system must avoid possibleanomalous results.
EVOLUTION OF DBMS
A database is a collection of information that exists over a long period of time. Adatabase management system (DBMS) is specialized software to maintain the database.
Before 1950s: Data was stored as paper records.
The first general-purpose DBMS was designed by Charles Bechman at General Electricin the early 1960s.
In 1970s, the hierearchical and Network Data Models were developed for complexdata structures like Invoices, Bills of different manufacturing goods.
6
DatabaseDatabaseDatabaseDatabaseDatabaseManagement SystemManagement SystemManagement SystemManagement SystemManagement System2
2.3
IBM developed a prototype relational database model as early as 1974 called SystemR, which would later become the widely used Structured Query Language(SQL) databaseupon its release in 1981.
In 1985, the Object Oriented DBMS was developed.
In 1990, the Object Oriented approach joint with Relational DBMS was developed. Inthis approach, text, multimedia, internet and web use in conjunction with DBMS wereavailable. Data Mining, data Warehousing, multimedia databases and Web databases weredeveloped.
In 1991, Micro Soft ships access, a personal DBMS was created .
In 1992, Microsoft Access was released.
In 1995, first Internet database applications were developed. Microsoft Access wasbundled with the Microsoft Office suite, and has become one of the most common desktopdatabases in use today.An open source personal computer databases in M y SQL releasedin 1995.
In 1997, XML applied to database processing, which solves long-standing databaseproblems.
In 2000s, Web technologies with XML, Data Integration, social networks, cloudcomputing, Global Information System was developed.
In 2007, technologies such as Big data and cloud computing were developed.
Database Management continues to gain importance as more and more data is broughtonline and made ever more accessible through computer networking. Today the field isbeing driven by exciting visions such as multimedia databases, interactive video, streamingdata, digital libraries, etc.
TYPES OF DATABASES
A DBMS can be used to build many different types of databases. Each databasestores a particular collection of data and is used for a specific purpose. Databases can beclassified by the number of users supported, where the data are located, the type of datastored, the intended data usage, and the degree to which the data are structured.
Classification Based on number of usersSingle-User database
A single-user database supports only one user at a time. A single-user databasethat runs on a personal computer is called a desktop database.
Multi User database
A multiuser database supports multiple users at the same time. When the multiuserdatabase supports a relatively small number of users (usually fewer than 50) ora specific department within an organization, it is called a workgroup database.
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System 77777
88888 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
When the database is used by the entire organization and supports many users(more than 50, usually hundreds) across many departments, the database isknown as an enterprise database.
Classification based on location
Centralized database
A database that supports data located at a single site is called a centralizeddatabase.
Distributed database
A database that supports data distributed across several different sites is calleda distributed database.
Homogeneous distributed database systems
Homogeneous distributed database systems use the same DBMS software frommultiple sites. Data exchange between these various sites can be handled easily.
Heterogeneous distributed database systems
In a heterogeneous distributed database system, different sites might use differentDBMS software, but there is additional common software to support data exchangebetween these sites.
Classification based on the type of data stored
General purpose database
It contains a wide variety of data used in multi discipline.
Ex: Newspaper, Magazines, etc.
Discipline specific database
It contains data focused on specific subject area.
Ex: medical database that stores confidential medical history data.
Operational database
A database that is designed primarily to support a company’s day to dayoperations.
Analytical database
This database focus primarily on storing historical data and business metric usedexclusively for tactical and strategic decisions.
Data warehouse
The data warehouse contains historical data obtained from operational databasesas well as data from other external sources.
2.4 DBMS APPROACH
A database is defined to be a collection of related information stored in a mannerthat many users share it for different purposes. The content of a database is obtained byintegrating data from all the different sources at a centralized location in an organization.Such data is made available to all users as per the requirements and redundant data canbe eliminated or at least minimized. The Data Base Management System (DBMS) governsto create an environment in which end users have better access to more and bettermanaged data than they did before the DBMS become the data management standard.
Some of the common database applications are student database system, businessinventory, accounting information, organization data etc. Some commercially availableDBMS are INGRES, ORACLE, DB2, Sybase, etc. A database management system, therefore,is a combination of hardware and software that can be used to set up and monitor adatabase, and can manage the updating and retrieval of database that has been stored init. Most database management systems support the following facilities/capabilities:
(a) Creation, modification and deletion of data files.
(b) Addition, modification, deletion of data
(c) Retrieving of data collectively or selectively
(d) Sorting or Indexing of data
(e) Creation of input forms and output reports. There may be either standardizedforms/reports or that may be specifically generated according to specific userdefinition.
(f) Manipulation of stored data with some mathematical functions, support forconcurrent transactions.
(g) To maintain data integrity and security
(h) To create an environment for Data warehousing and Data mining.
Advantages of DBMS
Reduction of RedundanciesReduction of RedundanciesReduction of RedundanciesReduction of RedundanciesReduction of Redundancies
Centralized control of data by the DBA avoids unnecessary duplication of dataand effectively reduces the total amount of data storage required. It also eliminatesthe extra processing necessary to trace the required data in a large storage ofdata. Another advantage of avoiding duplication is the elimination of theinconsistencies that tend to be present in redundant data files.
Sharing of DataSharing of DataSharing of DataSharing of DataSharing of Data
A database allows the sharing of data under its control by any number of applicationprograms or users.
Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System 99999
1010101010 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
Data IntegrityData IntegrityData IntegrityData IntegrityData Integrity
Centralized control can also ensure that adequate checks are incorporated in theDBMS to provide data integrity. Data integrity means that the data contained inthe database is both accurate and consistent. Therefore, data values being enteredfor storage could be checked to ensure that they fall within a specified range andare of the correct format.
Data SecurityData SecurityData SecurityData SecurityData Security
Data is of vital importance to an organization and may be confidential.Unauthorized persons must not access such confidential data. The DBA who hasthe ultimate responsibility for the data in the DBMS can ensure that proper accessprocedures are followed, including proper authentication schemes for access tothe DBMS and additional checks before permitting access to sensitive data.Different levels of security could be implemented for various types of data andoperations. The enforcement of security could be data value dependent, as wellas data-type dependent.
Conflict ResolutionConflict ResolutionConflict ResolutionConflict ResolutionConflict Resolution
Since the database is under the control of the DBA, she or he should resolve theconflicting requirements of various users and applications. In essence, the DBAchooses the best file structure and access method to get optimal performancefor the response-critical applications, while permitting less critical applications tocontinue to use the database, albeit with a relatively slower response.
Data IndependenceData IndependenceData IndependenceData IndependenceData Independence
Application programs should not, ideally, be exposed to details of datarepresentation and storage, The DBMS provides an abstract view of the data thathides such details.
Efficient Data AccessEfficient Data AccessEfficient Data AccessEfficient Data AccessEfficient Data Access
A DBMS utilizes a variety of sophisticated techniques to store and retrieve dataefficiently. This feature is especially important if the data is stored on externalstorage devices.
Concurrent Access and Crash RecoveryConcurrent Access and Crash RecoveryConcurrent Access and Crash RecoveryConcurrent Access and Crash RecoveryConcurrent Access and Crash Recovery
A DBMS schedules concurrent accesses to the data in such a manner that userscan think of the data as being accessed by only one user at a time. Further, theDBMS protects users from the effects of system failures.
3.1
Data models define how the logical structure of a database is modified. Data modelsare fundamental entities to introduce abstraction in DBMS. Data models define how datais connected to each other and how they are processed and stored inside the system.Within the database environment, a data model represents data structures and theircharacteristics, relations, constraints, transformations, and other constructs with thepurpose of supporting a specific problem domain.
Data models can facilitate interaction among the designer, the applicationsprogrammer, and the end user. A well-developed data model can even foster improvedunderstanding of the organization for which the database design is developed. In short,data models are a communication tool.
ANSI/SPARC MODEL
ANSI/SPARC (American National Standards Institute/ Standards Planning andRequirements Committee) model is the generalized architecture of a database system. Alarge number of commercial systems and research database models fit this framework.The architecture is divided into three levels: the external levelexternal levelexternal levelexternal levelexternal level, the conceptual levelconceptual levelconceptual levelconceptual levelconceptual level, andthe internal levelinternal levelinternal levelinternal levelinternal level.
The view at each of these levels is described by a schemeschemeschemeschemescheme. A scheme is an outline ora plan that describes the records and relationships existing in the view. The word scheme,which means a systematic plan for attaining some goal, is used interchangeably in thedatabase literature with the word schemaschemaschemaschemaschema.
External or User ViewExternal or User ViewExternal or User ViewExternal or User ViewExternal or User View
The external or user view is at the highest level of database abstraction whereonly those portions of the database of concern to a user or application programare included. Any number of user views may exist for a given global or conceptualview.
Data ModelData ModelData ModelData ModelData Model3
11
1212121212 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
Each external view is described by means of a scheme called an external schema.The external schema consists of the definition of the logical records and therelationships in the external view. The external schema also contains the methodof deriving the objects in the external view from the objects in the conceptualview. The objects includes entities, attributes, and relationships.
Conceptual or Global ViewConceptual or Global ViewConceptual or Global ViewConceptual or Global ViewConceptual or Global View
At this level of database abstraction all the database entities and the relationshipsamong them are included. One conceptual view represents the entire database.This conceptual view is defined by the conceptual schemaconceptual schemaconceptual schemaconceptual schemaconceptual schema. It describes all therecords and relationships included in the conceptual view and, therefore, in thedatabase. There is only one conceptual scheme per database. This schema alsocontains the method of deriving the objects in the conceptual view from theobjects in the internal view.
The description of data at this level is in a formal independent of its physicalrepresentation. It also includes features that specify the checks to retain dataconsistency and integrity.
Internal ViewInternal ViewInternal ViewInternal ViewInternal View
We find this view at the lowest level of abstraction, closest to the physical storagemethod used. It indicates how the data will be stored and describes the datastructures and access methods to be used by the database. The internal view isexpressed by the internal schema, which contains the definition of the storedrecord, the method of representing the data fields, and the access aids used.
External level EXTERNAL SCHEMA
User User User User view n
...database Users
Userview
Userview
Userview
...database designers
Conceptual level CONCEPTUAL SCHEMA
Internal level INTERNAL SCHEMA
Physical Database
File
File File
File File
File
Physical level
Architecture Interaction
Fig. Three-tier database architectureFig. Three-tier database architectureFig. Three-tier database architectureFig. Three-tier database architectureFig. Three-tier database architecture
3.2 DATA MODELS BASIC BUILDING BLOCKS
The basic blocks of all data models are entities, attributes, relationships and constraints.
Entity
An entity is anything (a person, a place, a thing or an event) about which data are tobe collected and stored. An entity represents a particular type of object in the real world.
Conceptual LevelConceptual LevelConceptual LevelConceptual LevelConceptual LevelField Name DataTypeRoll Number Number (5)Name Character (20)Address Character (40)Book Number Number (5)Data of Issue DateDate of Return DateFee Number (5 + 2)
Internal LevelInternal LevelInternal LevelInternal LevelInternal LevelStored Item LengthRoll Number T ype = Byte (8), Offset=0Name Type = Byte (20), Offset=6Address Type = Byte (40), Offset=26Book Number Type = Byte (6), Offset=66Data of Issue Type = Byte (8), Offset=72Date of Return Type = Byte (8), Offset=80Fee Type = Byte (8), Offset=88
External LevelExternal LevelExternal LevelExternal LevelExternal LevelView 2 (Account Office User)Required ValuesRoll NumberNameFee
External LevelExternal LevelExternal LevelExternal LevelExternal LevelView 1 (Library User)Required ValuesRoll NumberNameAddressBook NumberData of IssueDate of Return
Three Level Architecture of College Management SystemThree Level Architecture of College Management SystemThree Level Architecture of College Management SystemThree Level Architecture of College Management SystemThree Level Architecture of College Management System
Data ModalData ModalData ModalData ModalData Modal 1313131313
1414141414 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
3.4
3.3
Attribute
An attribute is a characteristic of an entity. For example, a CUSTOMER entity wouldbe described by attributes such as customer last name, customer first name, customerphone , customer address and customer credit limit. Attributes are equivalent of fields infile system.
Relationship
A relationship describes an association among entities. For example, a relationshipexists between customer and agents that can be described as, an agent can serve manycustomers, and each customer may be served by one agent.
Constraint
A constraint is restriction placed on the data. Constraints are because they help toensure data integrity. Constraints are normally expressed in the form of rules.
TYPES OF RELATIONSHIPS
There are three types of relationships between the tables. The type of relationshipthat is created depends on how the related columns are defined:
One-to-one relationship (1:1)
A pair of tables bears a one-to-one relationship when a single record in the first tableis related to only one record in the second table, and a single record in the second table isrelated to only one record in the first table.
One-to-Many Relationships (1:M)
A one-to-many relationship exists between a pair of tables when a single record inthe first table can be related to one or more records in the second table, but a singlerecord in the second table can be related to only one record in the first table.
Many-to-Many Relationships (M:M)
A pair of tables bears a many-to-many relationship when a single record in the firsttable can be related to one or more records in the second table and a single record in thesecond table can be related to one or more records in the first table.
TYPES OF DATA MODELS
Hierarchical modelHierarchical modelHierarchical modelHierarchical modelHierarchical model
Its basic logical structure is represented by an upside-down tree. The hierarchicalstructure contains level, or segments. The hierarchical model depicts a set ofone-to-many (1: M) relationships between a parent and its children segments.Each parent can have many children, but each child has only one parent.
The Network ModelThe Network ModelThe Network ModelThe Network ModelThe Network Model
The network model was created to represent complex data relationships moreeffective than the hierarchical model. In the network model, the user providesthe network database as a collection of records in 1:M relationships. Unlike thehierarchical model, the network model allows a record to have more than oneparent.
Network ModelNetwork ModelNetwork ModelNetwork ModelNetwork Model
The Relational ModelThe Relational ModelThe Relational ModelThe Relational ModelThe Relational Model
The relational data model is implemented through a very sophisticated relationaldatabase management system (RDBMS).
The RDBMS manages all of the physical details, while the user sees the relationaldatabase as a collection of tables in which data are stored. The user can manipulateand query the data in a way that seems intuitive and logical. Tables are related toeach other sharing of a common attribute (value in a column).
Hierarchical ModelHierarchical ModelHierarchical ModelHierarchical ModelHierarchical Model
Employee
Permanent Contract
Manager Software Engineer
Data ModalData ModalData ModalData ModalData Modal 1515151515
Store
Manager
ItemsSalesman
CustomerOrder
1616161616 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
The Entity Relationship ModelThe Entity Relationship ModelThe Entity Relationship ModelThe Entity Relationship ModelThe Entity Relationship Model
ER models are normally represented in an entity relationship diagram (ERD), whichuses graphical representations to model database components.
The ER model is based on the following components:
Entity:Entity:Entity:Entity:Entity: An entity is represented in the ERD by a rectangle, also known as anentity box. The name of the entity, a noun, is written in the center of the rectangle.
Attribute:Attribute:Attribute:Attribute:Attribute: Each entity is described by a set of attributes that describes particularcharacteristics of the entity. It is represented with an oval shape.
Relationship:Relationship:Relationship:Relationship:Relationship: Relationships describes associations among the data. Mostrelationships describes the association between two entities.
Department
No. NameProfessor
No. Name Dept No. Courses
Course
No. Dept No. Prof ID UnitStudent
ID Name Course
Relational ModelRelational ModelRelational ModelRelational ModelRelational Model
attribute attribute attribute attribute
Name
Marks Joining Date
Student EnrolledCourse
Roll No. Title
relationshipEntity Entity
The Object Oriented (OO) ModelThe Object Oriented (OO) ModelThe Object Oriented (OO) ModelThe Object Oriented (OO) ModelThe Object Oriented (OO) Model
In the object oriented data model (OODM), both data and their relationships arecontained in a single structure known as an object. Object oriented data modelsare typically depicted using Unified Modeling Language (UML) class diagrams.
Customer
Cust_no
Cust_name
Cust_address
Methods ()
Entity Relationship ModelEntity Relationship ModelEntity Relationship ModelEntity Relationship ModelEntity Relationship Model
Data ModalData ModalData ModalData ModalData Modal 1717171717
4.1
A DBMS is a complex software system that is used to manage, store, and manipulatedata and the metadata used to describe the data. It is utilized by a large variety of users,from the very naïve to the most sophisticated, to retrieve and manipulate data under itscontrol, the users could be utilizing the database concurrently from online terminals and/or in a batch environment via application programs written in a high level language.
CLASSIFICATION OF DBMS USERS
The users of a database system can be classified n the following groups, dependingon their degree of expertise or the mode of their interactions with DBMS.
Naïve users
Users who need not be aware of the presence of the database system or any othersystem supporting their usage are considered naive users. A user of an automatic tellermachine falls in this category.
Online users
These are users who may communicate with the database directly via a onlineterminal or indirectly via a user interface and application program. These users are awareof the presence of the database system and may have acquired a certain amount ofexpertise in the limited interaction they are permitted with the database through theintermediary of the application program. The more sophisticated of these users may alsouse a data manipulation language to manipulate the database directly. Online users canalso be naïve users requiring additional help, such as menus.
Application Programmers
Professional programmers who are responsible for developing application programsor user interfaces utilized by the naïve and online users fall into this category. The applicationprograms could be written in a general-----purpose programming language such as Assembler,C,,COBOL, FORTRAN, Pascal, or PL/I and include the commands required to manipulatethe database.
Components andComponents andComponents andComponents andComponents andInterfaces of DatabaseInterfaces of DatabaseInterfaces of DatabaseInterfaces of DatabaseInterfaces of DatabaseManagement SystemManagement SystemManagement SystemManagement SystemManagement System
4
18
4.2
Specialized users
Specialized users are sophisticated users who write specialized databaseapplications that do not fit into the traditional data-processing framework. Among theseapplications are computer-aided design systems, knowledge-base and expert systems,systems that store data with complex data types-modeling systems (for example, graphicsdata and audio data), and environment.
DATABASE ADMINISTRATOR
One of the main reasons for using DBMSs is to have central control of both the dataand the programs that access those data. A person who has such central control over thesystem is called a database administrator (DBAdatabase administrator (DBAdatabase administrator (DBAdatabase administrator (DBAdatabase administrator (DBA). The functions of a DBA include:
Schema definitionSchema definitionSchema definitionSchema definitionSchema definitionThe DBA creates the original database schema by executing a set of data definitionstatements in the DDL.
Storage structure and access-method definitionStorage structure and access-method definitionStorage structure and access-method definitionStorage structure and access-method definitionStorage structure and access-method definition
Schema and physical–organization modificationSchema and physical–organization modificationSchema and physical–organization modificationSchema and physical–organization modificationSchema and physical–organization modification
The DBA carries out changes to the schema and physical organization to reflectthe changing needs of the organization, or to alter the physical organization toimprove performance.
Granting of authorization for data accessGranting of authorization for data accessGranting of authorization for data accessGranting of authorization for data accessGranting of authorization for data access
By granting different types of authorization, the database administrator canregulate which parts of the database various users can access. The authorizationinformation is kept in a special system structure that the database system consultswhenever someone attempts to access the data in the system.
Routine maintenanceRoutine maintenanceRoutine maintenanceRoutine maintenanceRoutine maintenance
Examples of the database administrator’s routine maintenance activities are:
Periodically backing up the database, either onto tapes or onto remote servers,to prevent loss of data in case of disasters such as flooding.
Ensuring that enough free disk space is available for normal operations, andupgrading disk space as required.
Monitoring jobs running on the database and ensuring that performance is notdegraded by very expensive tasks submitted by some users.
Components and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management System 1919191919
2020202020 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
4.3 STRUCTURE OF DBMS
A database system is partitioned into modules that deal with each of the responsibilitiesof the overall system. The functional components of a database system can be broadlydivided into the storage manager and the query processor components.
4.3.1. Storage Manager
A storage manager is a program module that provides the interface between thelowlevel data stored n the database and the application programs and queries submittedto the system. The storage manager is responsible for the interaction with the file manager.The raw data are stored on the disk using the file system, which is usually provided by aconventional operating system. The storage manager translates the various DML statementsinto low-level file-system commands. Thus, the storage manager is responsible for storing,retrieving, and updating data in the database.
The storage manager components include:
Authorization and Integrity Manager, Authorization and Integrity Manager, Authorization and Integrity Manager, Authorization and Integrity Manager, Authorization and Integrity Manager, which tests for the satisfaction of integrityconstraints and checks the authority of users to access data.
Transaction Transaction Transaction Transaction Transaction MMMMManager, anager, anager, anager, anager, which ensures that the database remains in a consistentstate despite system failures, and that concurrent transaction executions proceedwithout conflicting.
File File File File File MMMMManager, anager, anager, anager, anager, which manages the allocation of space on disk storage and thedata structures used to represent information stored on disk.
Buffer Manager, Buffer Manager, Buffer Manager, Buffer Manager, Buffer Manager, which is responsible for fetching data from disk storage intomain memory, and deciding what data to cache in main memory. The buffermanager is a critical part of the database system, since it enables the databaseto handle data sizes that are much larger than the size of main memory.
The storage manager implements several data structures as part of the physicalsystem implementation:
Data files, Data files, Data files, Data files, Data files, which store the database itself.
Data dictionary,Data dictionary,Data dictionary,Data dictionary,Data dictionary, which stores metadata about the structure of the database, inparticular the schema of the database.
Indices, Indices, Indices, Indices, Indices, which provides fast access to data items that hold particular values.
4.3.2. Query Processor
The query processor components include
DDL interpreter, DDL interpreter, DDL interpreter, DDL interpreter, DDL interpreter, which interprets DDL statements and records the definitions inthe data dictionary.
DML compiler, DML compiler, DML compiler, DML compiler, DML compiler, which translates DML statements in a query language into anevaluation plan consisting of low-level instructions that the query evaluationengine understands.
4.4
A query can usually be translated into any of a number of alternative evaluationplansthat all give the same result. The DML compiler also performs query optimization, that is,it picks the lowest cost evaluation plan from among the alternatives.
Query evaluation engine, Query evaluation engine, Query evaluation engine, Query evaluation engine, Query evaluation engine, which executes low-level instructions generated by theDML compiler.
APPLICATION ARCHITECTURE
Most users of a database system today are not present at the site of the databasesystem, but connect to it through a network. We can therefore differentiate betweenclient machines, on which remote database users work, and server machines, on which thedatabase system runs.
Database applications are usually partitioned into two or three parts. In a two-tiertwo-tiertwo-tiertwo-tiertwo-tierarchitecturearchitecturearchitecturearchitecturearchitecture, the application is partitioned into a component that resides at the client
Components and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management SystemComponents and Interfaces of Database Management System 2121212121
Nalve UsersApplication
Programmer
ApplicationProgram Object Code
Compiler & Linker
DML Compiler & Organizer
Query Processor
Query EvaluationEngine
BufferManager
FileManager
Authorization &Integrity Manager
TransactionManager
Storage Manager
Disk Storage
DNL Queries DDL Interpreters
SophisticatedUsers
DatabaseAdministrator
Statistical DataData DictionaryIndicesData
ApplicationPrograms
ApplicationInterfaces
QueryTools
AdministrationTools
Figure : Sytem ArchitectureFigure : Sytem ArchitectureFigure : Sytem ArchitectureFigure : Sytem ArchitectureFigure : Sytem Architecture
2222222222 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
machine, which invokes database system functionality at the server machine throughquery language statements. Application program interface standards like ODBC and JDBCare used for interaction between the client and the server.
In contrast, in a three-tier architecture, the client machine acts as merely a front endand does not contain any direct database calls. Instead, the client end communicates withan application server, usually through a forms interface. The application server in turncommunicates with a database system to access data. The business logic of the application,which says what actions to carry out under what conditions, is embedded in the application
4.5
server, instead of being distributed across multiple clients. Three-tier applications aremore appropriate for large applications, and for applications that run on the World WideWeb.
SITUATIONS WHERE DBMS IS NOT NECESSARY
If unneccessary overhead costs are incurred compared to traditional file processingHigh initial investment in hardware, software, and trainingGenerality that a DBMS provides for defining and processing dataOverhead for providing security, concurrency control, recovery and integrityfunctionsImproper database designThe database and applications are simple, well defined, and not expected tochangeMultiple-user access to data is not required.
Client
Server
User
Application
Network
Database System
(a) Two-tier Architecture
User
Application Client
Network
Database System
(b) Three-tier Architecture
Application Server
This is a list of all the database management systems:
The systems are listed by type: relational(R), extended-relational(X), object-relational(OR), object-oriented(OO), network(N) and hierarchical(H). Note that somevendors state that their DBMS is more than one of these. In such a case the DBMS type isspecified by more than one designation. For example, Centura Software states that theirVelocis database is based on both the relational and network models, and in this case thedesignation “RN” has been specified.
For the primary market, some liberties have been taken with regard to the use of theterm “Enterprise.” Specifically, if a vendor does not indicate a primary market for theirDBMS, then the primary market has been specified as “Enterprise.”
DBMSDBMSDBMSDBMSDBMS VendorVendorVendorVendorVendor TypeTypeTypeTypeType Primary MarketPrimary MarketPrimary MarketPrimary MarketPrimary Market
Access (Jet, MSDE) Microsoft R Desktop
Adabas D Software AG R Enterprise
Adaptive Server Sybase R Mobile/Embedded
Anywhere
Adaptive Server Sybase R Enterprise
Enterprise
Advantage Database Extended Systems R Mobile/Enterprise
Server
Datacom Computer Associates R Enterprise
DB2 Everyplace IBM R Mobile
Filemaker FileMaker Inc. R Desktop
IDMS Computer Associates R Enterprise
Ingres ii Computer Associates R Enterprise
Interbase Inprise (Borland) R Open Source
DBMS Vendors andDBMS Vendors andDBMS Vendors andDBMS Vendors andDBMS Vendors and
Their ProductsTheir ProductsTheir ProductsTheir ProductsTheir Products5
23
2424242424 Database Management SystemDatabase Management SystemDatabase Management SystemDatabase Management SystemDatabase Management System
MySQL Freeware R Open Source
NonStop SQL Tandem R Enterprise
Pervasive.SQL 2000 Pervasive Software R Embedded
(Btrieve)
Pervasive.SQL Pervasive Software R Enterprise
Workgroup (Windows 32)
Progress Progress Software R Mobile/Embedded
Quadbase SQL Server Quadbase Systems, Inc. Relational Enterprise
R:Base R:Base Technologies Relational Enterprise
Rdb Oracle R Enterprise
Red Brick Informix (Red Brick) R Enterprise (Data
Warehousing)
SQL Server Microsoft R Enterprise
SQLBase Centura Software R Mobile/Embedded
SUPRA Cincom R Enterprise
Teradata NCR R VLDB (Data
Warehousing)
YARD-SQL YARD Software Ltd. R Enterprise
TimesTen TimesTen Performance
Software R In-Memory
Adabas Software AG XR Enterprise
Model 204 Computer Corporation
of America XR VLDB
UniData Informix (Ardent) XR Enterprise
UniVerse Informix (Ardent) XR Enterprise
Cache’ InterSystems OR Enterprise
Cloudscape Informix OR Mobile/Embedded
DB2 IBM OR Enterprise/VLDB
Informix Dynamic Informix OR Enterprise
Server 2000
Informix Extended Informix OR VLDB (Data
Parallel Server Warehousing)
Oracle Lite Oracle OR Mobile
Oracle 8I Oracle OR Enterprise
PointBase Embedded PointBase OR Embedded
PointBase Mobile PointBase OR Mobile
PointBase Network PointBase OR Enterprise
Server
PostgreSQL Freeware OR Open Source
UniSQL Cincom OR Enterprise
Jasmine ii Computer Associates OO Enterprise
Object Store Exceleron OO Enterprise
Objectivity DB Objectivity OO VLDB (Scientific)
POET Object Poet Software OO Enterprise
Server Suite
Versant Versant Corporation OO Enterprise
Raima Database Centura Software RN Mobile/Embedded
Manager
Velocis Centura Software RN Enterprise/
Embedded
Db.linux Centura Software RNH Open Source/
Mobile/Embedded
Db.star Centura Software RNH Open Source/
Mobile/Embedded
IMS DB IBM H Enterprise
DBMS Vendors and Their ProductsDBMS Vendors and Their ProductsDBMS Vendors and Their ProductsDBMS Vendors and Their ProductsDBMS Vendors and Their Products 2525252525
26
INTRODUCTION
The ER model defines the conceptual view of a database. It works around real-worldentities and the associations among them. The ER model perceives the real world asconsisting of basic objects, called entities, and relationships among these objects. It wasdeveloped to facilitate database design by allowing specification of an enterprise schema,which represents the overall logical structure of a database. It was developed to facilitatedatabase design by allowing specification of an enterprise schema, which represents theoverall logical structure of a database.
THE BUILDING BLOCKS OF AN E R DIAGRAM
The building blocks of an E R Diagram are entity sets, relationship sets, and attributes.
Entity setsEntity setsEntity setsEntity setsEntity sets
An entity entity entity entity entity is a “thing” or “object” in the real world that is distinguishable from allother objects. For example, each person in an enterprise is an entity. An entityhas a set of properties, and the values for some set of properties may uniquelyidentify an entity.
An entity setentity setentity setentity setentity set is a set of entities of the same type that share the some properties,or attributes. The set of all persons who are customers at a given bank, forexample, can be defined as the entity set customer.
Student NumberStudent NumberStudent NumberStudent NumberStudent Number Student NameStudent NameStudent NameStudent NameStudent Name GroupGroupGroupGroupGroup
1111111111 Rama BSc Entity 1
2222222222 Beena BCom Entity 2
3333333333 Madhavi BA Entity 3
6.1
6.2
Entit
y se
ts
UNIT - II
ER ModelER ModelER ModelER ModelER Model6
6.3
Relationship setsRelationship setsRelationship setsRelationship setsRelationship sets
A relationship is an association among several entities. For example we can definea relationship that associates customer Hayes with loan-15.
A relationship set is a set of relationships of the same type.
Consider the two entity sets customer and loan in the figure given below. Wedefine the relationship set borrower to denote the association between customersand the bank loans that customers have.
AttributesAttributesAttributesAttributesAttributes
An attribute is a property or characteristic of an entity.
Possible attributes of customer entity set are customer_id, customer_name,customer_street, and customer_city.
CLASSIFICATION OF ENTITY SETS
An entity can be a person, place, event, or object that is relevant to a given system.
Weak EntityWeak EntityWeak EntityWeak EntityWeak Entity: The entity set which does not have sufficient attributes to form aprimary key is called as Weak entity. Member of weak entity set is called assubordinate entity.
Strong EntityStrong EntityStrong EntityStrong EntityStrong Entity: An entity set that has a primary key is called as Strong entity. Amember of a strong entity set is called dominant entity.
ER ModelER ModelER ModelER ModelER Model 2727272727
321-12-3123 Jones Main Harrison
019-28-3746 Smith North Rye
677-89-9011 Hayes Main Harrison
555-55-5555 Jackson Dupont Woodside
244-66-8800 Curry North Rye
963-96-3963 Williams Nassau Princeton
335-57-7991 Adams Spring Pittsfield
L-17 1000
L-23 2000
L-15 1500
L-14 1500
L-19 500
L-11 900
L-16 1300
loancustomer