Database Management System Introduction A database management system is a computer based system to manage a database, or a collection databases or files. The essential word here is manage management implies the controlled use of a resource, that is controlling its quality coordinating shared use, of a resource, that is, controlling its quality, coordinating shared use and controlling access to authorized users.
A DBMS has many uses: – it enables users to access and manipulate the database. it provides a building block in constructing data processing systems for applications requiring database access – MIS or systems for accounting, production and inventory control or customer support. – it helps the DBA perform certain managerial duties.
The name ‘database management system’ was chosen recognizing that different names are in use and different types of systems exist. Substantial generalization is assumed in any DBMS of interest without using ‘generalized. ’ ‘Data is preferred over ‘information’ for the various reasons cited.Functions of a Database Management System: – Database Definition – Database creation (storing data in a defined database) – Retrieval (query and reporting) – Update(Changing the contents of the database) – Programming User Facilities for system development) – Database revision and restructuring – Database integrity control – Performance Monitoring Overview of Relationships in Database Management: In a database environment, the main components, or players are database users, a database administrator, applications programs, and the DBMS.
People can access the database directly using a DBMS, or they can write a program (or have a programmer write one for them, or use a previously written program) in cases requiring special or more complex processing. The DBA establishes and periodically revises the database to meet the needs of the users. The DBA establishes integrity controls. The users and the DBA communicate formally and informally about system use and database access, and about the regulations and standards in force. Application programs and the DBMS are processes executed by machine.While accessing and controlling the database, the DBMS has three distinct interfaces – with users, with the DBA and with programs. Database users access the database directly using the facilities of the database management system or through a program written by themselves. The database administrator establishes the database and the controls on people and programs using the database.
The Database Administrator must be a manager, rather than a technician – seeking to meet the needs of people who use data.Since many users may share the same data resources, the DBA must be repared to mediate conflicting needs and objectives, sometimes imposing a compromise solution. Functions of Database Administration are as follows: – Define, acquire and retire data according to the user needs. – Provide tools to access and update the data and produce reports. – Inform and assist users in planning and using data resources and database management tools. – Maintain database integrity by protecting its existence, maintaining its quality and controlling access to private data. – Monitor operations for efficient performance and integrity threats.The central idea behind managing data resources is getting a handle on organizational data resources which support operations and management decisions.
Proper management of data also promotes the use of data. Solving the problem of data management entails both the administrative and technical factors: creating an effective organizational structure and appointing a responsible authority called the Database Administrator and using computer based facilities along with associated operating personnel and procedures. History Databases have been in use since the earliest days of electronic computing.Unlike modern systems which can be applied to widely different databases and needs, the vast majority of older systems were tightly linked to the custom databases in order to gain speed at the expense of flexibility. Originally DBMSs were found only in large organizations with the computer hardware needed to support large data sets. 1960s Navigational DBMS As computers grew in capability, this trade-off became increasingly unnecessary and a number of general-purpose database systems emerged; by the mid-1960s there were a number of such systems in commercial use.Interest in a standard began to grow, and Charles Bachman, author of one such product, Integrated Data Store (IDS), founded the “Database Task Group” within CODASYL, the group responsible for the creation and standardization of COBOL.
In 1971 they delivered their standard, which generally became known as the “Codasyl approach”, and soon there were a number of commercial products based on it available. The Codasyl approach was based on the “manual” navigation of a linked data set which was formed into a large network.When the database was first opened, the program was handed back a link to the first record in the database, which also contained pointers to other pieces of data. To find any particular record the programmer had to step through these pointers one at a time until the required record was returned. Simple queries like “find all the people in India” required the program to walk the entire data set and collect the matching results. There was, essentially, no concept of “find” or “search”.This might sound like a serious limitation today, but in an era when the data was most often stored on magnetic tape such operations were too expensive to contemplate anyway. IBM also had their own DBMS system in 1968, known as IMS.
IMS was a development of software written for the Apollo program on the System/360. IMS was generally similar in concept to Codasyl, but used a strict hierarchy for its model of data navigation instead of Codasyl’s network model. Both concepts later became known as navigational databases due to the way data as accessed, and Bachman’s 1973 Turing Award award presentation was The Programmer as Navigator. IMS is classified as a hierarchical database. IDS and IDMS, both CODASYL databases, as well as CINCOMs TOTAL database are classified as network databases. 1970s Relational DBMS Edgar Codd worked at IBM in San Jose, California, in one of their offshoot offices that was primarily involved in the development of hard disk systems. He was unhappy with the navigational model of the Codasyl approach, notably the lack of a “search” facility which was becoming increasingly useful.
In 1970, he wrote a number of papers that outlined a new approach to database construction that eventually culminated in the groundbreaking A Relational Model of Data for Large Shared Data Banks. In this paper, he described a new system for storing and working with large databases. Instead of records being stored in some sort of linked list of free-form records as in Codasyl, Codd’s idea was to use a “table” of fixed-length records. A linked-list system would be very inefficient when storing “sparse” databases where some of the data for any one record could be left empty.The relational model solved this by splitting the data into a series of normalized tables, with optional elements being moved out of the main table to where they would take up room only if needed. In the relational model, related records are linked together with a “key”.
For instance, a common use of a database system is to track information about users, their name, login information, various addresses and phone numbers. In the navigational approach all of these data would be placed in a single record, and unused items would simply not be placed in the database.In the relational approach, the data would be normalized into a user table, an address table and a phone number table (for instance).
Records would be created in these optional tables only if the address or phone numbers were actually provided. Linking the information back together is the key to this system. In the relational model, some bit of information was used as a “key”, uniquely defining a particular record. When information was being collected about a user, information stored in the optional (or related) tables would be found by searching for this key.For instance, if the login name of a user is unique, addresses and phone numbers for that user would be recorded with the login name as its key. This “re-linking” of related data back into a single collection is something that traditional computer languages are not designed for. Just as the navigational approach would require programs to loop in order to collect records, the relational approach would require loops to collect information about any one record. Codd’s solution to the necessary looping was a set-oriented language, a suggestion that would later spawn the ubiquitous SQL.
Using a branch of mathematics known as tuple calculus, he demonstrated that such a system could support all the operations of normal databases (inserting, updating etc. ) as well as providing a simple system for finding and returning sets of data in a single operation. Codd’s paper was picked up by two people at the Berkeley, Eugene Wong and Michael Stonebraker. They started a project known as INGRES using funding that had already been allocated for a geographical database project, using student programmers to produce code.Beginning in 1973, INGRES delivered its first test products which were generally ready for widespread use in 1979.
During this time, a number of people had moved “through” the group — perhaps as many as 30 people worked on the project, about five at a time. INGRES was similar to System R in a number of ways, including the use of a “language” for data access, known as QUEL — QUEL was in fact relational, having been based on Codd’s own Alpha language, but has since been corrupted to follow SQL, thus violating much the same concepts of the relational model as SQL itself.IBM itself did only one test implementation of the relational model, PRTV, and a production one, Business System 12, both now discontinued. Honeywell did MRDS for Multics, and now there are two new implementations: Alphora Dataphor and Rel. All other DBMS implementations usually called relational are actually SQL DBMSs. In 1968, the University of Michigan began development of the Micro DBMS relational database management system. It was used to manage very large data sets by the US Department of Labor, the Environmental Protection Agency and researchers from University of Alberta, the University of Michigan and Wayne State University.It ran on mainframe computers using Michigan Terminal System.
The system remained in production until 1996. End 1970s SQL DBMS IBM started working on a prototype system loosely based on Codd’s concepts as System R in the early 1970s. The first “quickie” version was ready in 1974/5, and work then started on multi-table systems in which the data could be broken down so that all of the data for a record (much of which is often optional) did not have to be stored in a single large “chunk”.Subsequent multi-user versions were tested by customers in 1978 and 1979, by which time a standardized query language, SQL, had been added. Codd’s ideas were establishing themselves as both workable and superior to Codasyl, pushing IBM to develop a true production version of System R, known as SQL/DS, and, later, Database 2 (DB2). Many of the people involved with INGRES became convinced of the future commercial success of such systems, and formed their own companies to commercialize the work but with an SQL interface.Sybase, Informix, NonStop SQL and eventually Ingres itself were all being sold as offshoots to the original INGRES product in the 1980s. Even Microsoft SQL Server is actually a re-built version of Sybase, and thus, INGRES.
Only Larry Ellison’s Oracle started from a different chain, based on IBM’s papers on System R, and beat IBM to market when the first version was released in 1978. Stonebraker went on to apply the lessons from INGRES to develop a new database, Postgres, which is now known as PostgreSQL.PostgreSQL is primarily used for global mission critical applications (the . org and . info domain name registries use it as their primary data store, as do many large companies and financial institutions). In Sweden, Codd’s paper was also read and Mimer SQL was developed from the mid-70s at Uppsala University. In 1984, this project was consolidated into an independent enterprise.
In the early 1980s, Mimer introduced transaction handling for high robustness in applications, an idea that was subsequently implemented on most other DBMS. Shalamar Hospital Lahore HistoryThe Businessmen Hospital Trust established Shalamar Hospital in 1982 as a not- for- profit Hospital to cater the needs of patients belonging to the lower income population of Lahore, a historic city with over 7 million populations. With the sustained efforts of the Board of Trust and the Management of Hospital, Shalamar Hospital has grown to 350 beds and is now amongst major health care providers in Lahore. Shalamar Hospital was founded in 1982, built by generous contributions by its founders- Chaudhry Nazar Mohammad, Chaudhry Mohammad Hussain and Syed Babar Ali.The main objective of the founders was to establish a not – for – profit hospital, which would provide health care services to patients from all income groups, especially to lower and middle social classes. Hospital is owned and managed by the Businessman Hospital Trust. The Board of Trust comprises of 8 members who had been putting efforts in this joint endeavor to bring it at par with the international standards in health care sector.
The hospital is located in the northern part of Lahore, cosmopolitan capital of the Punjab Province.The services provided at the hospital have moved with the times and provides high quality multidisciplinary services. From six specialties originally, now the hospital provides a comprehensive range of consultation, diagnosis and treatment services for almost all medical and surgical specialties through its hospital based clinical services and community based outreach programme. The hospital is easily accessible to patients from other cities. Today, we are a modern well- equipped 350 bedded hospital providing elective medical and surgical services.In recent years the hospital has increasingly been able to provide services for patients who are non- affording. The hospital places great emphasis on quality care, providing comfortable, and infection free environment and a range of clinical services which are tailored to meet the needs of individual patients.
The hospital has a Chief Executive and highly qualified and experienced professionals. The hospital has been recognized by Pakistan Medical and Dental Council and College of Physicians and Surgeons Pakistan for the training of fellowship and diploma in different faculties.The outpatient department (OPD) provides consultation to about 1000 patients in Walk in and Private Clinics during day time and at evening. The number of patients coming for consultation and diagnosis makes it one of the busiest hospitals amongst the private sector health care institutes. The out reach program (ORP) caters to the needs of people living in the outskirts of Lahore on alternate days.
The hospital is equipped with 9 most modern theatres to provide surgical facilities to patients of general surgery, gynecological procedures and emergency trauma cases.Almost all types of diagnostic and surgical procedures are performed. Existing System File Processing System (FPS) Hospital is currently using this system, which have following disadvantages: 1.
Program-Data Dependence. File descriptions are stored within each application program that accesses a given file. 2.
Duplication of Data. Applications are developed independently in file processing systems leading to unplanned duplicate files. Duplication is wasteful as it requires additional storage space and changes in one file must be made manually in all files. This also results in loss of data integrity.It is also possible that the same data item may have different names in different files, or the same name may be used for different data items in different files.
3. Limited data sharing. Each application has its own private files with little opportunity to share data outside their own applications. A requested report may require data from several incompatible files in separate systems. 4. Lengthy Development Times. There is little opportunity to leverage previous development efforts.
Each new application requires the developer to start from scratch by designing new file formats and descriptions 5. Excessive Program Maintenance.The preceding factors create a heavy program maintenance load.
6. Integrity Problem. The problem of integrity is the problem of ensuring that the data in the database is accentuate. 7. Inconsistance data 8. Security . The Problem of security in file processing is Non Programmer can retrieve modify, delete and insert the data in data base. But this is not possible in DBMS Analysis of DBMS and FPS Warehouse of Information The database management systems are warehouses of information, where large amount of data can be stored.
The common examples in commercial applications are inventory data, personnel data, etc.It often happens that a common man uses a database management system, without even realizing, that it is being used. The best examples for the same, would be the address book of a cell phone, digital diaries, etc. Both these equipments store data in their internal database. Defining Attributes The unique data field in a table is assigned a primary key.
The primary key helps in the identification of data. It also checks for duplicates within the same table, thereby reducing data redundancy. There are tables, which have a secondary key in addition to the primary key.The secondary key is also called ‘foreign key’.
The secondary key refers to the primary key of another table, thus establishing a relationship between the two tables. Systematic Storage The data is stored in the form of tables. The tables consists of rows and columns. The primary and secondary key help to eliminate data redundancy, enabling systematic storage of data. Changes to Schema The table schema can be changed and it is not platform dependent. Therefore, the tables in the system can be edited to add new columns and rows without hampering the applications, that depend on that particular database.No Language Dependence The database management systems are not language dependent. Therefore, they can be used with various languages and on various platforms.
Table Joins The data in two or more tables can be integrated into a single table. This enables to reduce the size of the database and also helps in easy retrieval of data. Multiple Simultaneous Usage The database can be used simultaneously by a number of users. Various users can retrieve the same data simultaneously. The data in the database can also be modified, based on the privileges assigned to users. Data SecurityData is the most important asset. Therefore, there is a need for data security.
Database management systems help to keep the data secured. Privileges Different privileges can be given to different users. For example, some users can edit the database, but are not allowed to delete the contents of the database. Abstract View of Data and Easy Retrieval DBMS enables easy and convenient retrieval of data. A database user can view only the abstract form of data; the complexities of the internal structure of the database are hidden from him. The data fetched is in user friendly format.
Data Consistency Data consistency ensures a consistent view of data to every user. It includes the accuracy, validity and integrity of related data. The data in the database must satisfy certain consistency constraints, for example, the age of a candidate appearing for an exam should be of number datatype and in the range of 20-25. When the database is updated, these constraints are checked by the database systems. Entity Relationship Development An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships between entities in a database.ER diagrams often use symbols to represent three different types of information. Boxes are commonly used to represent entities.
Diamonds are normally used to represent relationships and ovals are used to represent attributes. Entities Strong Entities ? Patient ? Doctor ? Drugs ? Pharmacy ? Pharmaceutical Co. Associative Entities ? Prescription ? Sale ? Contract Patient It is strong entity. It has following attributes: Serial No (Identifier), Name, Age, and Address [pic] Doctor It is Strong entity. It has following attributes: Physician serial (Identifier), Name, Specialty, and Experience Years [pic] DrugsIt is Strong entity. Drugs are available in pharmacy. It has following attributes: Trade Name (Identifier), Quantity [pic] Pharmacy It is Strong entity.
Hospital has its own pharmacies. It has following attributes: Name Address, Phone No. [pic] Pharmaceutical Co. It is Strong entity. This company makes medicines for pharmacy of hospital.
It has following attributes: Name (Identifier), Phone No [pic] Prescription It is associative entity. It helps to make relationship between Patient, Doctor, and Drugs. Which patient is treated by which doctor and which doctor prescribes which drugs to which patient.