Sie sind auf Seite 1von 17

Database Management Systems

Unit 1

Unit 1
Structure: 1.1 Introduction Objectives 1.2 1.3 1.4 1.5 What is Database? Database System Applications Data Independence Data Modeling for a Database Entities and their attributes Relationships and types 1.6 1.7 1.8 1.9

Basic Concepts of DBMS

Advantages and Disadvantages of DBMS DBMS Vs RDBMS Summary Terminal Questions

1.10 Answers

1.1 Introduction
In this unit we will introduce the basic concepts of DBMS. Database technology has evolved rapidly in the three decades since the rise and eventual dominance of relational database systems. While many specialized database systems (object-oriented, spatial, multimedia, etc.) have found substantial user communities in the science and engineering fields, relational systems remain the dominant database technology for business enterprises. A database is a collection of related information stored so that it is available to many users for different purposes. The content of a database is obtained by combining data from all the different sources in an organization, so that data are available to all users and redundant data can be eliminated or
Sikkim Manipal University Page No. 1

Database Management Systems

Unit 1

atleast minimized. A computer database gives us some electronic filing system, which has a large number of ways of cross-referencing and this allows the user many different ways in which to reorganize and retrieve data. Objectives: By the end of Unit 1 the learners are able to Understand definition of database and database management system Study the applications of Database System Understand Modeling for a Database Understand advantages and disadvantages of DBMS Differentiate between DBMS and RDBMS

1.2 What is Database?


The database is a collection of related data. The basic component of a file in a file system is a data item, which is the smallest named unit of data that has meaning in the real world for example, last name, first name, street address, ID number, or political party. A group of related data items treated as a single unit by an application is called a record. Examples of types of records are order, salesperson, customer, product, and department. A file is a collection of records of a single type. A database has the following implicit properties: A database represents some aspect of the real world, sometimes called the miniworld or universe of discourse (UoD). Changes to the miniworld are reflected in the database. A database is a logically coherent collection of data with some inherent meaning. A database is designed, built, and populated with data for a specific purpose.
Sikkim Manipal University Page No. 2

Database Management Systems

Unit 1

A database is a more complex object; it is a collection of interrelated stored data that serves the needs of multiple users within one or more organizations, that is, interrelated collections of many different types of tables. The motivations for using databases rather than files include greater availability to a diverse set of users, integration of data for easier access to and updating of complex transactions, and less redundancy of data. Some of the basic definitions of database concepts are: Data: Data is known facts that can be recorded and have an implicit meaning. Database: Database is a collection of related data. Database System: Database System is the DBMS software together with the data itself. Sometimes, the applications are also included. Database Management System (DBMS): Database Management System is a software package/system to facilitate the creation and maintenance of a computerized database. Examples for database management systems are MS Access, DB2, ORACLE, SQL Server, SYBASE, INFORMIX etc. A database can handle business inventory, accounting and filing and use the information in its files to prepare summaries, estimates and other reports. There can be a database which stores new paper articles, magazines, books and comics. There is already a well-defined market for specific information for a highly selected group of users on almost all subjects. The management of data in a database system is done by means of a general purpose software package called a database management system. The database management system is the major software component of a database system. A database management system, therefore, is a combination of hardware and software that can be used to set
Sikkim Manipal University Page No. 3

Database Management Systems

Unit 1

up and monitor a database, and can manage the updating and retrieval of the database that has been stored in it. Most database management systems have the following facilities/capabilities: Creating of a file, addition to data, deletion of data, modification of data; creation, addition and deletion of entire files. Retrieving data collectively or selectively. The data stored can be sorted or indexed at the user's discretion and direction. Various reports can be produced from the system. These may be either standardized reports or that may be specifically generated according to specific user definition. Mathematical functions can be performed and the data stored in the database can be manipulated with these functions to perform the desired calculations. Self Assessment Questions 1.2 1. The basic component of a file in a file system is a _________. 2. UoD stands for ___________. 3. Database Management System is a _________ system to facilitate the creation and maintenance of a computerized database. 4. The database management system is the major software component of a ___________.

1.3 Database System Applications


Databases are widely used. Here are some representative applications: Banking: For customer information, accounts, and loans, and banking transactions. Airlines: For reservations and schedule information. Airlines were among the first to use databases in a geographically distributed manner
Sikkim Manipal University Page No. 4

Database Management Systems

Unit 1

terminals situated around the world accessed the central database system through phone lines and other data networks. Universities: For student information, course registrations, and grades. Credit card transactions: For purchases on credit cards and generation of monthly statements. Telecommunication: For keeping records of calls made, generating monthly bills, maintaining balances on prepaid calling cards, and storing information about the communication networks. Finance: For storing information about holdings, sales, and purchases of financial instruments such as stocks and bonds. Sales: For customer, product, and purchase information. Manufacturing: For management of supply chain and for tracking production of items in factories, inventories of items in warehouses/ stores, and orders for items. Human resources: For information about employees, salaries, payroll taxes and benefits, and for generation of paychecks. As the list illustrates, databases form an essential part of almost all enterprises today. Over the course of the last four decades of the twentieth century, use of databases grew in all enterprises. In the early days, very few people interacted directly with database systems, although without realizing it they interacted with databases indirectly through printed reports such as credit card statements, or through agents such as bank tellers and airline reservation agents. Then automated teller machines came along and let users interact directly with databases. Phone interfaces to computers (interactive voice response systems) also allowed users to deal directly with databases a caller could dial a number, and press phone keys to enter

Sikkim Manipal University

Page No. 5

Database Management Systems

Unit 1

information or to select alternative options, to find flight arrival/departure times, for example, or to register for courses in a university. The internet revolution of the late 1990s sharply increased direct user access to databases. Organizations converted many of their phone interfaces to databases into Web interfaces, and made a variety of services and information available online. For instance, when you access an online bookstore and browse a book or music collection, you are accessing data stored in a database. When you enter an order online, your order is stored in a database. When you access a bank Web site and retrieve your bank balance and transaction information, the information is retrieved from the banks database system. When you access a Web site, information about you may be retrieved from a database, to select which advertisements should be shown to you. Furthermore, data about your Web accesses may be stored in a database. Thus, although user interfaces hide details of access to a database, and most people are not even aware they are dealing with a database, accessing databases forms an essential part of almost everyones life today. The importance of database systems can be judged in another way today, database system vendors like Oracle are among the largest software companies in the world, and database systems form an important part of the product line of more diversified companies like Microsoft and IBM. Self Assessment Questions 1.3 1. _________ were among the first to use databases in a geographically distributed manner. 2. Web accesses may be stored in a ________ . 3. The __________ machines came along and let users interact directly with databases.

Sikkim Manipal University

Page No. 6

Database Management Systems

Unit 1

4. In ________ database is used for keeping records of calls made, generating monthly bills, maintaining balances on prepaid calling cards, and storing information about the communication networks.

1.4 Data Independence


Data independence is usually considered from two points of view: physical data independence and logical data independence. Physical data independence allows changes in the physical storage devices or organization of the files to be made without requiring changes in the conceptual view or any of the external views and hence in the application programs using the database. Thus, the files may migrate from one type of physical media to another or the file structure may change without any need for changes in the application programs. Logical data independence implies that application programs need not be changed if fields are added to an existing record; nor do they have to be changed if fields not used by application programs are deleted. Logical data independence indicates that the conceptual schema can be changed without affecting the existing external schemas. Data independence is advantageous in the database environment, since it allows for changes at one level of the database, without affecting other levels. These changes are absorbed by the mappings between the levels. Logical data independence is more difficult to achieve than physical independence. Since application programs are heavily dependent on the logical structure of the data they access. The concept of data independence is similar in many respects to the concept of abstract data type in modern programming languages like C++. Both hide implementation details from the users. This allows users to concentrate on the general structure rather than low-level implementation details.
Sikkim Manipal University Page No. 7

Database Management Systems

Unit 1

Self Assessment Questions 1.4 1. Data independence is usually considered from _____ points of view. 2. ____________ data independence allows changes in the physical storage devices. 3. ____________ data independence implies that application programs need not be changed if fields are added to an existing record. 4. Logical data independence is more ______ to achieve than physical independence.

1.5 Data modeling for a database


The data model is one part of the conceptual design process. The other is the function model. The data model focuses on what data should be stored in the database while the function model deals with how the data is processed. To put this in the context of the relational database, the data model is used to design the relational tables. The functional model is used to design the queries that will access and perform operations on those tables. Data modeling is preceded by planning and analysis. The effort devoted to this stage is proportional to the scope of the database. The planning and analysis of a database intended to serve the needs of an enterprise will require more effort than one intended to serve a small workgroup. 1.5.1 Entities and their attributes The entity-relationship (E-R) data model based on a perception of real world that consists of a set of basic objects called entities, and of relationships among these objects. It was developed to facilitate database design by allowing the specification of an enterprise schema, which represents the overall logical structure of a database. The E-R data model is one of several semantic data models; the semantic aspect of the model lies in the attempt to represent the meaning of the data. The E-R model is extremely
Sikkim Manipal University Page No. 8

Database Management Systems

Unit 1

useful in mapping and interactions of real-world enterprises onto a conceptual schema. Because of this utility, many database- design tools draw on concepts from the E-R model. More about the E-R model is explained in Unit 3 (Entity-Relationship Model). 1.5.1.1 Entities Entities are the principal data objects about which information is to be collected; they usually denote a person, place, thing, or event of informational interest. A particular occurrence of an entity is called an entity instance or sometimes an entity occurrence. Consider a Company database; here employee, department, division, project, skill, and location are all examples of entities. You will get more examples for entities in Unit 3 (Entity-Relationship Model). 1.5.1.2 Attributes Attributes are characteristics of entities that provide descriptive details about them. A particular occurrence of an attribute within an entity or relationship is called an attribute value. Attributes of an entity such as Employee may include emp-id, emp-name, emp-address, phone-no, faxno, job-title, and so on. The attribute is connected to the entity it characterizes. There are two types of attributes: identifiers and descriptors. An identifier (or key) is used to uniquely determine an instance of an entity also known as key attribute; a descriptor (or nonkey attribute) is used to specify a nonunique characteristic of a particular entity instance. Both identifiers and descriptors may consist of either a single attribute or some composite of attributes. For example, an identifier or key attribute of an Employee is emp-id, and a descriptor of an Employee is emp-name or job-title. Entities have internal identifiers that uniquely determine the existence of entity instances, but weak entities derive their identity from the identifying attributes of one or
Sikkim Manipal University Page No. 9

Database Management Systems

Unit 1

more parent entities. Weak entities are often depicted with a doublebordered rectangle, which denotes that all occurrences of that entity depend on an associated (strong) entity for their existence in the database. More about attributes is explained in Unit 3 (Entity-Relationship Model). 1.5.2 Relationships and Relationship Types 1.5.2.1 Relationships Relationships represent real-world associations among one or more entities, and, as such, have no physical or conceptual existence, other than that which depends upon their entity associations. Relationships are described in terms of degree, connectivity, and existence. These terms are defined in the sections that follow. The most common meaning associated with the term relationship is indicated by the connectivity between entity occurrences: one-to-one, one-to-many, and many-to-many. The relationship construct is a diamond that connects the associated entities. The relationship name can be written inside or just outside the diamond. A role is the name of one end of a relationship, when each end needs a distinct name for clarity of the relationship. The entity names combined with the relationship name clearly define the individual roles of each entity in the relationship. However, in some cases role names should be used to clarify ambiguities. Role names are typically nouns. More information about relationships and its types is given in Unit 3 (Entity-Relationship Model). 1.5.2.2 Relationships Types An E-R enterprise schema may define certain constraints to which the contents of a database must conform. Mapping cardinalities, or cardinality ratios, express the number of entities to which another entity can be associated via a relationship set.

Sikkim Manipal University

Page No. 10

Database Management Systems

Unit 1

For a binary relationship set R between entity sets A and B, the mapping cardinality must be one of the following: One-to-one (1:1): An entity in A is associated with at most one entity in B, and an entity B is associated with at most one entity in A. One-to-many (1:N): An entity in A is associated with any number of entities in B. An entity in B, however can be associated with at most one entity in A. Many-to-one (N:1): An entity in A is associated with at most one entity in B. An entity in B, however can be associated with any number of entities in A. Many-to-many: An entity in A is associated with any number of entities in B. An entity in B, is associated with any number of entities in A. Self Assessment Questions 1.5 1. The _________ is one part of the conceptual design process. 2. Data modeling is preceded by __________ and analysis. 3. The E-R data model based on a perception of real world that consists of a set of basic objects called _________. 4. A particular occurrence of an entity is called an entity _________. 5. An entity in A is associated with at most one entity in B, and an entity B is associated with at most one entity in A, this type of relationship is _________. 6. In one-to-many relationships, an entity in A is associated with any number of entities in B. An entity in B, however can be associated with at most ________ entity in A.

1.6 Advantages and Disadvantages of Database Management System


One of the main advantages of using a database system is that the organization can exert, via the DBA, centralized management and control
Sikkim Manipal University Page No. 11

Database Management Systems

Unit 1

over the data. The database administrator is the focus of the centralized control. Any application requiring a change in the structure of a data record requires an arrangement with the DBA, who makes the necessary modifications. The following are the important advantages of DBMS. 1.6.1 Advantages Reduction of Redundancies Centralized control of data by the DBA avoids unnecessary duplication of data, and effectively reduces the total amount of data storage required. It also eliminates the extra processing necessary to trace the required data in a large mass of data. Another advantage of avoiding duplication is the elimination of the inconsistencies that tend to be present in redundant data files. Any redundancies that exist in the DBMS are controlled and the system ensures that these multiple copies are consistent. Sharing Data A database allows the sharing of data under its control by any number of application programs or users. Data Integrity Centralized control can also ensure that adequate checks are incorporated in the DBMS to provide data integrity. Data integrity means that the data contained in the database is both accurate and consistent. Therefore, data values being entered for storage could be checked to ensure that they fall within a specified range and are of the correct format. For example, the value for the age of an employee may be in the range of 16 and 75. Another integrity check that should be incorporated in the database is to ensure that if there is a reference to certain object, that object must exist. In the case of an automatic teller machine, for example, a user is not allowed to transfer funds from a nonexistent saving account to a checking account.

Sikkim Manipal University

Page No. 12

Database Management Systems

Unit 1

Data Security Data is of vital importance to an organization and may be confidential. Such confidential data must not be accessed by unauthorized persons. The DBA, who has the ultimate responsibility for the data in the DBMS, can ensure that proper access procedures are followed, including proper authentication schemas for access to the DBMS, and additional checks before permitting access to sensitive data. Different levels of security could be implemented for various types of data and operations. The enforcement of security could be data value dependent (e.g., a manager has access to the salary details of employees in his or her department only), as well as data-type dependent (but the manager cannot access the medical history of any employees, including those in his or her department). Conflict Resolution Since the database is under the control of the DBA, she or he should resolve the conflicting requirements of various users and applications. in essence, the DBA chooses the best file structure and access method to get optimal Performance for the response-critical applications, while permitting less critical applications to continue to use the database, albeit with a relatively slower response. 1.6.2 Disadvantages A significant disadvantage of the DBMS system is cost. In addition to the cost of purchasing or developing the software, the hardware has to be upgraded to allow for the extensive programs and the work spaces required for their execution and storage. The processing overhead introduced by the DBMS to implement security, integrity, and sharing of the data causes a degradation of the response and through-put times. An additional cost is that of migration from a traditionally separate application environment to an integrated one.
Sikkim Manipal University Page No. 13

Database Management Systems

Unit 1

While centralization reduces duplication, the lack of duplication requires that the database be adequately backed up, so that, in the case of failure, the data can be recovered. Backup and recovery operations are fairly complex in a DBMS environment, and this is exacerbated in a concurrent multiuser database system. Furthermore, a database system requires a certain amount of controlled redundancies and duplication to enable access to related data items. Centralization also means that the data is accessible from a single source namely the database. This increases the potential severity of security breaches and disruption of the operation of the organization because of downtimes and failures. The replacement of a monolithic centralized database by a federation of independent and cooperating distributed databases resolves some of the problems resulting from failures and downtimes. Self Assessment Questions 1.6 1. The database administrator is the focus of the ________ control. 2. Any redundancies that exist in the DBMS are controlled and the system ensures that these multiple copies are _________. 3. ________ means that the data contained in the database is both accurate and consistent. 4. Data is of _________ importance to an organization and may be confidential. 5. A significant disadvantage of the DBMS system is ________.

1.7 DBMS vs RDBMS


The market leading DBMS products today are all SQL DBMS products. They were originally based on the relational database management model but did not implement the model fully or completely accurately. First of all, the SQL DBMS allows the data to be queried based on any column in any
Sikkim Manipal University Page No. 14

Database Management Systems

Unit 1

table. Relational/SQL data is easier to query than hierarchical, CODASYL, or some other model. Secondly, because the relational model is based on set theory its accuracy and usefulness have a basis in mathematics. Indeed, a basis in mathematics that is centuries old and proven. Additionally, a relational database describes data in terms of its natural structure only that is, it excludes all details having to do with machine representation. That should give you some idea of the benefits of relational database management systems over other types. Self Assessment Questions 1.7 1. Relational/SQL data is ________ to query than hierarchical, CODASYL, or some other model. 2. The relational model is based on _________ its accuracy and usefulness has a basis in mathematics.

1.8 Summary
A database system is an integrated collection of related files along with the details about their definition, interpretation, manipulation and maintenance. A DBMS is a major software component of database system. It consists of collection of interrelated data and programs to access that data. The primary goal of a DBMS is to provide an environment which is both convenient and efficient to use in retrieving information from and storing information into the database. The DBMS not only makes the integrated collection of reliable and accurate data available to multiple applications and users but also prohibits

Sikkim Manipal University

Page No. 15

Database Management Systems

Unit 1

unauthorized users to access the data. The DBMS has its own advantages and disadvantages. DBMS is different from RDBMS.

1.9 Terminal Questions


1. List out the database implicit properties. 2. What are the representative applications of Databases? List them. 3. Differentiate between physical data independence and logical data independence. 4. What are entities and attributes? Give one example 5. What are relationships? Explain the relationship types. 6. Explain the Advantages and Disadvantages of the DBMS 7. Compare DBMS with RDBMS.

1.10 Answers to Self Assessment Questions


Answers to Self Assessment Questions 1.2 1. data item 2. Universe of Discourse 3. software 4. database system Answers to Self Assessment Questions 1.3 1. Airlines 2. Database 3. Automated teller 4. Telecommunication Answers to Self Assessment Questions 1.4 1. Two 2. Physical 3. Logical 4. difficult
Sikkim Manipal University Page No. 16

Database Management Systems

Unit 1

Answers to Self Assessment Questions 1.5 1. data model 2. planning 3. entities 4. instance 5. one-to-one 6. one Answers to Self Assessment Questions 1.6 1. Centralized 2. Consistent 3. Data integrity 4. Vital 5. Cost Answers to Self Assessment Questions 1.7 1. Easier 2. set theory

Sikkim Manipal University

Page No. 17

Das könnte Ihnen auch gefallen